/* ===================================================================
   TOP 10 GLOBAL RANKING - CSS PARA CS 1.6 MOTD (BASEADO NO AK47)
   Autor: MAJESTIC S+Z
   Versão: 2025 - OTIMIZADO
   Compatível com: Counter-Strike 1.6 MOTD
   =================================================================== */

/* Reset básico e configurações globais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Tahoma', 'Arial', sans-serif;
    font-size: 12px;
    line-height: 1.4;
    color: #ffffff;
    background: url('http://www.majesticsz.ihosts3.pt/adp3.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-position: center center;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Container principal - AUMENTADO para nomes longos */
.container {
    max-width: 1000px; /* AUMENTADO para 1000px - mais espaço horizontal */
    margin: 20px auto;
    padding: 15px;
    background: rgba(5, 10, 30, 0.9);
    border-radius: 8px;
    box-shadow: 0 0 25px rgba(0, 191, 255, 0.5);
    border: 2px solid rgba(0, 255, 255, 0.8);
    position: relative;
}

/* Título principal */
h1 {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: #00FFFF;
    margin-bottom: 15px;
    padding: 10px;
    background: linear-gradient(90deg, transparent, rgba(0, 50, 100, 0.3), transparent);
    border-radius: 4px;
}

/* Layout 2 colunas - USANDO TABLE PARA MÁXIMA COMPATIBILIDADE */
.two-columns {
    display: table;
    width: 100%;
    table-layout: fixed;
    border-spacing: 10px;
}

.column {
    display: table-cell;
    width: 50%;
    vertical-align: top;
    padding: 0;
    margin: 0;
}

/* Tabela principal - BASEADO NO CSS AK47 FUNCIONAL */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 auto;
    background: rgba(0, 30, 60, 0.9);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.5);
    table-layout: fixed;
    vertical-align: top;
}

/* Larguras específicas das colunas - OTIMIZADO para 5 colunas com Deaths */
th:nth-child(1), td:nth-child(1) { width: 7%; }   /* Pos - reduzido */
th:nth-child(2), td:nth-child(2) { width: 50%; }  /* Jogador - ainda com máximo espaço */
th:nth-child(3), td:nth-child(3) { width: 15%; }  /* Premier - reduzido */
th:nth-child(4), td:nth-child(4) { width: 14%; }  /* Kills - reduzido */
th:nth-child(5), td:nth-child(5) { width: 14%; }  /* Deaths - nova coluna */

/* Cabeçalho da tabela - MELHORADO */
th {
    background: linear-gradient(135deg, #001a33 0%, #004080 50%, #0066ff 100%);
    color: #ffffff;
    font-weight: bold;
    font-size: 11px;
    padding: 10px 4px;
    text-align: center;
    border-bottom: 2px solid #00FFFF;
    position: relative;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.8);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Remove border da última coluna do cabeçalho */
th:last-child {
    border-top-right-radius: 8px;
}

th:first-child {
    border-top-left-radius: 8px;
}

/* Linhas da tabela */
td {
    padding: 8px 4px;
    text-align: center;
    font-size: 16px; /* UNIFORMIZADO: todas as colunas 16px */
    font-weight: bold; /* UNIFORMIZADO: todas bold */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    vertical-align: middle; /* ALINHAMENTO vertical centralizado */
    height: 40px; /* ALTURA fixa para evitar desalinhamento */
    position: relative;
}

/* Estilo das linhas alternadas - MELHORADO */
tr.a {
    background: linear-gradient(90deg, rgba(0, 50, 100, 0.3), rgba(0, 50, 100, 0.15));
    border-left: 4px solid #0066CC;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

tr.b {
    background: linear-gradient(90deg, rgba(0, 255, 255, 0.2), rgba(0, 255, 255, 0.1));
    border-left: 4px solid #00FFFF;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Hover effect nas linhas - MELHORADO */
tr:hover {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.3), rgba(255, 215, 0, 0.2)) !important;
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.5);
    border-left: 5px solid #FFD700 !important;
    transition: all 0.3s ease;
}

/* Coluna de posição - UNIFORMIZADO + Background diferenciado */
td:first-child {
    color: #00FFFF; /* Cor única para todas as posições */
    background: rgba(0, 50, 100, 0.25); /* OPÇÃO 4: Azul mais forte - coluna ímpar */
    /* font-size e font-weight herdados do td geral (16px, bold) */
}

/* Coluna do nome do jogador - UNIFORMIZADA + Background diferenciado */
td:nth-child(2) {
    color: #ffffff;
    text-align: left; /* Alinhamento à esquerda para nomes longos */
    padding: 8px 8px 8px 12px; /* Mais padding à esquerda */
    white-space: nowrap; /* EVITA quebra de linha - mantém em 1 linha */
    overflow: hidden; /* Esconde excesso se necessário */
    text-overflow: ellipsis; /* Adiciona "..." se nome muito longo */
    vertical-align: middle; /* Alinhamento vertical centralizado */
    background: rgba(0, 80, 40, 0.18); /* OPÇÃO 4: Verde-azul - coluna par */
    /* font-size e font-weight herdados do td geral (16px, bold) */
}

/* Premier Rating - UNIFORMIZADO + Background diferenciado */
td:nth-child(3) {
    color: #FFD700;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    text-align: center;
    vertical-align: middle;
    padding: 8px 4px;
    background: rgba(0, 50, 100, 0.25); /* OPÇÃO 4: Azul mais forte - coluna ímpar */
    /* font-size e font-weight herdados do td geral (16px, bold) */
}

/* Kills - UNIFORMIZADO + Background diferenciado */
td:nth-child(4) {
    color: #66B2FF;
    background: rgba(0, 80, 40, 0.18); /* OPÇÃO 4: Verde-azul - coluna par */
    text-align: center;
    vertical-align: middle;
    /* font-size e font-weight herdados do td geral (16px, bold) */
}

/* Deaths - NOVA COLUNA + Background diferenciado */
td:nth-child(5) {
    color: #FF6666;
    background: rgba(0, 50, 100, 0.25); /* OPÇÃO 4: Azul forte - coluna ímpar (igual POS e PREMIER) */
    text-align: center;
    vertical-align: middle;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    /* font-size e font-weight herdados do td geral (16px, bold) */
}

/* ========== PREMIER TIER COLORS ========== */
/* Sistema unificado - apenas cores de tier diferenciam os jogadores */

/* Responsividade para CS 1.6 MOTD */
@media screen and (max-width: 700px) {
    body {
        font-size: 10px;
    }
    
    .container {
        max-width: 95%;
        margin: 5px auto;
        padding: 8px;
        border-radius: 4px;
    }
    
    h1 {
        font-size: 14px;
        margin-bottom: 8px;
        padding: 5px;
    }
    
    th, td {
        font-size: 16px; /* CORRIGIDO: manter 16px mesmo em mobile */
        padding: 4px 2px;
    }
    
    table {
        border-radius: 4px;
    }
    
    .two-columns {
        border-spacing: 5px;
    }
    
    /* Ajustar larguras em mobile - OTIMIZADO para 5 colunas com Deaths */
    th:nth-child(1), td:nth-child(1) { width: 7%; }   /* Pos - reduzido */
    th:nth-child(2), td:nth-child(2) { width: 45%; }  /* Jogador - reduzido mas ainda prioritário */
    th:nth-child(3), td:nth-child(3) { width: 16%; }  /* Premier */
    th:nth-child(4), td:nth-child(4) { width: 16%; }  /* Kills */
    th:nth-child(5), td:nth-child(5) { width: 16%; }  /* Deaths - nova coluna */
}

/* ===== SISTEMA PREMIER - 7 TIER COLORS (OTIMIZADO) ===== */
.p1 { color: #909090 !important; text-shadow: 0 0 5px rgba(144, 144, 144, 0.5) !important; }
.p2 { color: #87CEEB !important; text-shadow: 0 0 5px rgba(135, 206, 235, 0.5) !important; }
.p3 { color: #4169E1 !important; text-shadow: 0 0 5px rgba(65, 105, 225, 0.5) !important; }
.p4 { color: #9370DB !important; text-shadow: 0 0 5px rgba(147, 112, 219, 0.5) !important; }
.p5 { color: #FF69B4 !important; text-shadow: 0 0 5px rgba(255, 105, 180, 0.5) !important; }
.p6 { color: #FF4500 !important; text-shadow: 0 0 5px rgba(255, 69, 0, 0.5) !important; }
.p7 { color: #FFD700 !important; text-shadow: 0 0 5px rgba(255, 215, 0, 0.5) !important; }

/* Compatibilidade CS 1.6 - Fallbacks */
@media screen and (max-width: 500px) {
    .two-columns {
        display: block;
    }
    
    .column {
        display: block;
        width: 100%;
        margin-bottom: 10px;
    }
}

/* ===== "TUA POSIÇÃO" CENTRALIZADA - UNIFORMIZADA ===== */
.my-position {
    text-align: center;
    margin: 15px auto 10px auto;
    padding: 8px 15px;
    background: rgba(0, 50, 100, 0.4);
    border: 1px solid rgba(0, 255, 255, 0.6);
    border-radius: 6px;
    max-width: 300px;
    font-size: 16px; /* UNIFORMIZADO: mesmo que tabelas */
    font-weight: bold; /* UNIFORMIZADO: mesmo que tabelas */
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 191, 255, 0.3);
    text-shadow: 0 1px 3px rgba(0,0,0,0.8); /* Mesmo shadow que tabelas */
}

/* ===== SISTEMA PREMIER - 7 TIER COLORS ===== */
.premier-gray { 
    color: #909090 !important; 
    text-shadow: 0 0 8px rgba(144, 144, 144, 0.8) !important; 
}
.premier-lightblue { 
    color: #87CEEB !important; 
    text-shadow: 0 0 8px rgba(135, 206, 235, 0.8) !important; 
}
.premier-blue { 
    color: #4169E1 !important; 
    text-shadow: 0 0 8px rgba(65, 105, 225, 0.8) !important; 
}
.premier-purple { 
    color: #9370DB !important; 
    text-shadow: 0 0 8px rgba(147, 112, 219, 0.8) !important; 
}
.premier-pink { 
    color: #FF69B4 !important; 
    text-shadow: 0 0 8px rgba(255, 105, 180, 0.8) !important; 
}
.premier-red { 
    color: #FF4500 !important; 
    text-shadow: 0 0 8px rgba(255, 69, 0, 0.8) !important; 
}
.premier-yellow { 
    color: #FFD700 !important; 
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.8) !important; 
}

/* ===== ANIMAÇÕES E EFEITOS AVANÇADOS ===== */
.container {
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Efeito pulsante no título */
h1 {
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        text-shadow: 0 0 15px rgba(0, 255, 255, 0.8), 0 0 30px rgba(0, 255, 255, 0.4);
    }
    50% {
        text-shadow: 0 0 25px rgba(0, 255, 255, 1), 0 0 50px rgba(0, 255, 255, 0.6);
    }
}

/* Efeito hover especial nas colunas de dados */
td:nth-child(3):hover, td:nth-child(4):hover, td:nth-child(5):hover {
    transform: scale(1.1);
    transition: transform 0.2s ease;
    background: rgba(255, 215, 0, 0.3) !important;
}

/* Destaque para top 3 posições */
tr.a td:first-child:contains("1"), 
tr.b td:first-child:contains("1") {
    color: #FFD700 !important;
    text-shadow: 0 0 10px rgba(255, 215, 0, 1) !important;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(255, 215, 0, 0.1)) !important;
}

tr.a td:first-child:contains("2"), 
tr.b td:first-child:contains("2") {
    color: #C0C0C0 !important;
    text-shadow: 0 0 10px rgba(192, 192, 192, 1) !important;
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.3), rgba(192, 192, 192, 0.1)) !important;
}

tr.a td:first-child:contains("3"), 
tr.b td:first-child:contains("3") {
    color: #CD7F32 !important;
    text-shadow: 0 0 10px rgba(205, 127, 50, 1) !important;
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.3), rgba(205, 127, 50, 0.1)) !important;
}

.my-position span {
    font-weight: bold; /* Mantém bold igual ao container */
    font-size: inherit; /* Herda o mesmo tamanho (16px) */
    text-shadow: inherit; /* Herda o mesmo shadow */
}
