/* ==========================================================================
   Top Frags
   --------------------------------------------------------------------------
   Mesmos papeis de cor do resto do tema:
     --gold   estrutura      --ember  destaque
     --danger frag injusto   --online frag justo
     --rune   secundario

   Aqui o vermelho carrega significado, nao decoracao: e a fatia injusta do total,
   que e o que gera skull no jogo.

   Sprites em ESCALA INTEIRA: o gerador devolve 64x64, entao ladrilho = 64 + 2 da
   borda (o tema usa box-sizing: border-box). Tamanho fracionario com
   `image-rendering: pixelated` descarta pixel de forma irregular e suja o desenho.
   ========================================================================== */

.tf-panel {
    background: var(--panel);
    border: 1px solid var(--edge);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.tf-panel::before {
    content: "";
    display: block;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-line), transparent);
}

.tf-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 18px;
    background: linear-gradient(180deg, rgba(201, 169, 97, .07), transparent);
    border-bottom: 1px solid var(--edge);
}

.tf-head-title {
    font-family: var(--f-display);
    font-size: 19px;
    letter-spacing: .07em;
    color: var(--gold-soft);
    text-transform: uppercase;
}

.tf-head-title i { color: var(--danger); margin-right: 8px; }
.tf-head-sub { font-family: var(--f-body); font-size: 12.5px; color: var(--muted); }

/* --------------------------------------------------------------- periodos */

.tf-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 16px 18px 6px;
}

.tf-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 16px;
    border: 1px solid var(--edge);
    border-radius: 999px;
    background: rgba(0, 0, 0, .3);
    color: var(--ink-dim) !important;
    font-family: var(--f-display);
    font-size: 13px;
    letter-spacing: .05em;
    text-transform: uppercase;
    text-decoration: none !important;
    transition: border-color .15s, color .15s, background .15s;
}

.tf-tab b { font-family: var(--f-mono); font-size: 12px; color: var(--muted); }
.tf-tab:hover { border-color: var(--edge-strong); color: var(--ink) !important; }

.tf-tab.is-on {
    border-color: var(--ember-lo);
    background: rgba(224, 112, 42, .16);
    color: var(--ember-soft) !important;
    box-shadow: 0 0 18px var(--ember-glow);
}

.tf-tab.is-on b { color: var(--ember-soft); }

/* --------------------------------------------------------------- podio */

.tf-podium {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
    padding: 18px 14px 8px;
    align-items: end;
}

.tf-pod {
    position: relative;
    border: 1px solid var(--edge);
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(0, 0, 0, .25));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}

/* Ordem visual 2 - 1 - 3, como um podio. A ordem do HTML segue 1, 2, 3 para leitor
   de tela e para a numeracao; so a apresentacao muda. */
.tf-pod-1 { order: 2; }
.tf-pod-2 { order: 1; }
.tf-pod-3 { order: 3; }

.tf-pod-1 {
    border-color: var(--ember-lo);
    background: linear-gradient(180deg, rgba(224, 112, 42, .18), rgba(0, 0, 0, .3));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 0 26px var(--ember-glow);
}

.tf-pod-rank {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--ground-deep);
    border: 1px solid var(--edge-strong);
    font-family: var(--f-mono);
    font-size: 13px;
    font-weight: 700;
    color: var(--gold-soft);
}

.tf-pod-1 .tf-pod-rank { border-color: var(--ember); color: var(--ember-soft); }

.tf-pod-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 20px 12px 14px;
    text-decoration: none !important;
    text-align: center;
}

.tf-pod-name {
    font-family: var(--f-display);
    font-size: 15px;
    letter-spacing: .04em;
    color: var(--ink);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tf-pod-1 .tf-pod-name { color: var(--ember-soft); }

.tf-pod-voc { font-family: var(--f-body); font-size: 11.5px; color: var(--rune); }
.tf-pod-voc i { color: var(--gold-dim); margin-right: 4px; }
.tf-gone { color: var(--muted); font-style: italic; }

.tf-pod-n {
    margin-top: 7px;
    font-family: var(--f-mono);
    font-size: 26px;
    font-weight: 700;
    color: var(--gold-soft);
    line-height: 1;
}

.tf-pod-1 .tf-pod-n { color: var(--ember-soft); text-shadow: 0 0 12px var(--ember-glow); }

.tf-pod-cap {
    font-family: var(--f-body);
    font-size: 9.5px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--muted);
}

/* Barra justo x injusto. O fundo verde e o total; o preenchimento vermelho e a
   fatia injusta. Uma barra so conta a proporcao inteira. */
.tf-bar {
    display: block;
    width: 100%;
    max-width: 150px;
    height: 6px;
    margin-top: 9px;
    border-radius: 999px;
    background: rgba(92, 203, 119, .45);
    overflow: hidden;
}

.tf-bar-fill { display: block; height: 100%; background: var(--danger); }

.tf-pod-split {
    display: flex;
    gap: 10px;
    margin-top: 5px;
    font-family: var(--f-body);
    font-size: 10.5px;
}

.tf-just   { color: var(--online); font-weight: 400; }
.tf-unjust { color: var(--danger);  font-weight: 400; }

/* --------------------------------------------------------------- sprite */

.tf-avatar {
    width: 66px;
    height: 66px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: radial-gradient(80% 80% at 50% 30%, rgba(201, 169, 97, .12), rgba(0, 0, 0, .4));
    border: 1px solid var(--edge);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, .5);
    overflow: hidden;
    color: var(--gold-dim);
    flex: 0 0 auto;
}

.tf-avatar img { width: 64px; height: 64px; object-fit: none; image-rendering: pixelated; }

/* Especificidade maior de proposito: `.tf-avatar-lg img` sozinho empata com
   `.tf-avatar img` e perderia por vir depois. 128 = 2x exato. */
.tf-avatar-lg { width: 130px; height: 130px; margin-bottom: 5px; }
.tf-avatar.tf-avatar-lg img { width: 128px; height: 128px; }

/* --------------------------------------------------------------- tabela */

.tf-table-wrap { overflow-x: auto; }   /* a rolagem fica aqui, nunca no body */

.tf-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--f-body);
    font-size: 13px;
}

.tf-table thead th {
    padding: 10px 12px;
    text-align: left;
    font-size: 10px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
    background: rgba(201, 169, 97, .07);
    border-top: 1px solid var(--edge);
    border-bottom: 1px solid var(--edge);
    white-space: nowrap;
}

.tf-table tbody td {
    padding: 9px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, .05);
    color: var(--ink-dim);
    white-space: nowrap;
}

.tf-table tbody tr:hover td { background: rgba(224, 112, 42, .07); }

.tf-table a {
    color: var(--ink) !important;
    text-decoration: none !important;
    font-family: var(--f-display);
    letter-spacing: .03em;
}

.tf-table a:hover { color: var(--ember-soft) !important; }

.tf-t-rank { width: 52px; text-align: center; font-family: var(--f-mono); color: var(--muted); }
.tf-t-num  { text-align: right; font-family: var(--f-mono); }
.tf-t-voc i { color: var(--gold-dim); margin-right: 5px; }
.tf-t-time { color: var(--rune); font-size: 11.5px; }
.tf-t-frags { color: var(--gold-soft); }
.tf-t-nil { color: #4d5a58; }

/* --------------------------------------------------------------- vazio e rodape */

.tf-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 44px 22px;
    text-align: center;
    font-family: var(--f-body);
}

.tf-empty i { font-size: 26px; color: var(--gold-dim); }
.tf-empty b { font-family: var(--f-display); font-size: 16px; letter-spacing: .04em; color: var(--ink); }
.tf-empty small { color: var(--muted); }

.tf-foot {
    padding: 12px 18px;
    border-top: 1px solid var(--edge);
    background: rgba(0, 0, 0, .22);
    font-family: var(--f-body);
    font-size: 12px;
    color: var(--muted);
    text-align: center;
}

.tf-foot i { color: var(--gold-dim); margin-right: 5px; }
.tf-foot a { color: var(--rune) !important; }

/* --------------------------------------------------------------- celular */

@media (max-width: 620px) {
    .tf-podium { grid-template-columns: 1fr; align-items: stretch; }
    /* Empilhado, volta a 1-2-3: em coluna, "o maior no meio" nao le. */
    .tf-pod-1, .tf-pod-2, .tf-pod-3 { order: 0; }
    .tf-tab { padding: 6px 12px; font-size: 12px; }
    .tf-pod-n { font-size: 22px; }
}
