/* ========================================
   SERVER PAGE - Character Selection
   ======================================== */

.server-page-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 100px 24px 60px;
    font-family: 'Nunito', sans-serif;
}

/* Two-Column Layout */
.server-content-layout {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

.server-chars-col {
    flex: 1;
    min-width: 0;
}

.server-ranking-col {
    width: 320px;
    flex-shrink: 0;
    position: sticky;
    top: 100px;
}

/* Header */
.server-page-header {
    text-align: center;
    margin-bottom: 40px;
}

.server-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ddt-text-muted, #64748B);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
    transition: color 0.2s ease;
}

.server-back-link:hover {
    color: var(--ddt-blue, #4A90D9);
}

.server-page-title h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--ddt-text, #1E293B);
    margin: 0 0 6px 0;
}

.server-page-title p {
    font-size: 16px;
    color: var(--ddt-text-muted, #64748B);
    margin: 0;
}

/* Create Character Button */
.server-actions-bar {
    text-align: center;
    margin-bottom: 32px;
}

.ddt-btn-create-char {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: linear-gradient(135deg, var(--ddt-green, #10B981), #059669);
    color: #fff;
    text-decoration: none;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 700;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.ddt-btn-create-char:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

/* Characters Grid */
.characters-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

/* Character Card */
.character-card-new {
    background: #fff;
    border: 2px solid #E2E8F0;
    border-radius: 16px;
    display: flex;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.character-card-new:focus-visible {
    outline: 3px solid rgba(74, 144, 217, 0.5);
    outline-offset: 2px;
}

.character-card-new:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    border-color: #CBD5E1;
}

/* Avatar Section */
.char-avatar {
    width: 160px;
    min-height: 180px;
    background: linear-gradient(180deg, rgba(74, 144, 217, 0.1) 0%, rgba(74, 144, 217, 0.03) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
    border-right: 1px solid #E2E8F0;
}

.char-avatar-layers {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 160px;
    height: 192px;
    overflow: hidden;
}

.char-avatar-layers img {
    max-width: none;
    max-height: none;
}

.char-face-wrap {
    position: absolute;
    left: 35px;
    top: 15px;
    z-index: 1;
}

.char-face-wrap img {
    height: 140px;
    max-width: unset;
}

.char-hair {
    position: absolute;
    left: 37px;
    top: 21px;
    height: 130px;
    max-width: unset;
    z-index: 2;
}

.char-cloth {
    position: absolute;
    left: 36px;
    top: 21px;
    height: 130px;
    max-width: unset;
    z-index: 3;
}

.char-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #CBD5E1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 800;
    color: #fff;
}

.char-placeholder span {
    text-transform: uppercase;
}

.char-level {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

/* Details Section */
.char-details {
    flex: 1;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.char-name-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.char-name-row h3 {
    font-size: 20px;
    font-weight: 700;
    color: #1E293B;
    margin: 0;
}

.pass-tag {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pass-active {
    background: #ECFDF5;
    color: #059669;
    border: 1px solid #A7F3D0;
}

.pass-expired {
    background: #FEF2F2;
    color: #DC2626;
    border: 1px solid #FECACA;
}

/* Stats */
.char-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.char-stat {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #64748B;
}

.char-stat svg {
    flex-shrink: 0;
}

.stat-val {
    font-size: 15px;
    font-weight: 700;
    color: #1E293B;
}

.stat-lbl {
    font-size: 12px;
    color: #94A3B8;
    font-weight: 600;
}

/* Actions */
.char-actions {
    display: flex;
    gap: 12px;
}

.ddt-btn-play-server {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    background: linear-gradient(135deg, #4A90D9, #3B7DD8);
    color: #fff;
    text-decoration: none;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(74, 144, 217, 0.3);
}

.ddt-btn-play-server:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 144, 217, 0.4);
}

.ddt-btn-recharge {
    display: inline-flex;
    align-items: center;
    padding: 10px 24px;
    background: transparent;
    color: #F59E0B;
    border: 2px solid #F59E0B;
    text-decoration: none;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.2s ease;
}

.ddt-btn-recharge:hover {
    background: rgba(245, 158, 11, 0.08);
    transform: translateY(-2px);
}

.ddt-btn-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: transparent;
    color: #64748B;
    border: 2px solid #CBD5E1;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.ddt-badge-new {
    position: absolute;
    top: -10px;
    right: -6px;
    padding: 3px 8px;
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: #fff;
    border-radius: 50px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    animation: ddt-badge-pulse 1.6s ease-in-out infinite;
}

@keyframes ddt-badge-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.12); }
}

.ddt-btn-actions:hover {
    background: #F1F5F9;
    border-color: #94A3B8;
    color: #334155;
    transform: translateY(-2px);
}

/* Modal de Acoes do Personagem */
.char-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.char-modal-overlay.open {
    display: flex;
}

.char-modal {
    background: #fff;
    border-radius: 20px;
    padding: 32px 28px 24px;
    width: 100%;
    max-width: 480px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    max-height: 90vh;
    overflow-y: auto;
}

.char-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    color: #94A3B8;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.char-modal-close:hover {
    background: #FEF2F2;
    color: #EF4444;
}

.char-modal-title {
    font-size: 20px;
    font-weight: 800;
    color: #1E293B;
    margin: 0 0 20px;
}

.char-action-item {
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 16px;
}

.char-action-info h4 {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 700;
    color: #1E293B;
}

.char-action-info p {
    margin: 0;
    font-size: 13px;
    color: #64748B;
    line-height: 1.5;
}

.ddt-btn-reset-consumo {
    align-self: flex-start;
    padding: 10px 20px;
    background: linear-gradient(135deg, #F59E0B, #D97706);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.ddt-btn-reset-consumo:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

.ddt-btn-reset-consumo:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.char-action-feedback {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
}

.char-action-feedback.success {
    background: #ECFDF5;
    color: #047857;
    border: 1px solid #A7F3D0;
}

.char-action-feedback.error {
    background: #FEF2F2;
    color: #B91C1C;
    border: 1px solid #FECACA;
}

/* Trocar Nickname */
.char-modal .char-action-item + .char-action-item {
    margin-top: 12px;
}

.ddt-btn-change-nickname {
    align-self: flex-start;
    padding: 10px 20px;
    background: linear-gradient(135deg, #3B82F6, #2563EB);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.ddt-btn-change-nickname:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.ddt-btn-change-nickname:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.char-nickname-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #E2E8F0;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    outline: none;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.char-nickname-input:focus {
    border-color: #3B82F6;
}

/* No Characters */
.no-characters-new {
    text-align: center;
    padding: 60px 24px;
    background: #fff;
    border: 2px dashed #E2E8F0;
    border-radius: 16px;
}

.no-characters-new svg {
    margin-bottom: 16px;
    opacity: 0.4;
}

.no-characters-new p {
    font-size: 18px;
    font-weight: 700;
    color: #1E293B;
    margin: 0 0 6px 0;
}

.no-characters-new span {
    font-size: 14px;
    color: #64748B;
}

/* ========================================
   PVP RANKING
   ======================================== */
.ranking-section {
    margin-top: 0;
}

.ranking-header {
    text-align: center;
    margin-bottom: 24px;
}

.ranking-header h2 {
    font-size: 24px;
    font-weight: 800;
    color: #1E293B;
    margin: 0 0 6px 0;
}

.ranking-header p {
    font-size: 15px;
    color: #64748B;
    margin: 0;
}

.ranking-table-wrap {
    background: #fff;
    border: 2px solid #E2E8F0;
    border-radius: 16px;
    overflow: hidden;
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
}

.ranking-table thead {
    background: #F8FAFC;
    border-bottom: 2px solid #E2E8F0;
}

.ranking-table th {
    font-size: 13px;
    font-weight: 700;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 20px;
    text-align: left;
}

.ranking-table th.rank-col {
    width: 60px;
    text-align: center;
}

.ranking-table td {
    padding: 12px 20px;
    font-size: 14px;
    color: #1E293B;
    border-bottom: 1px solid #F1F5F9;
}

.ranking-table td.rank-col {
    text-align: center;
}

.ranking-row:last-child td {
    border-bottom: none;
}

.ranking-row:hover {
    background: #F8FAFC;
}

/* Top 3 - fundos sutis */
.ranking-row--top1 {
    background: rgba(245, 158, 11, 0.06);
}

.ranking-row--top2 {
    background: rgba(148, 163, 184, 0.08);
}

.ranking-row--top3 {
    background: rgba(205, 127, 50, 0.06);
}

/* Linha do proprio usuario */
.ranking-row--me {
    background: rgba(74, 144, 217, 0.08);
    box-shadow: inset 3px 0 0 #4A90D9;
}

.ranking-row--me:hover {
    background: rgba(74, 144, 217, 0.12);
}

.ranking-me-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    background: #4A90D9;
    color: #fff;
    border-radius: 50px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    vertical-align: middle;
}

.ranking-hidden {
    display: none;
}

/* Rank Badges */
.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 800;
    color: #fff;
}

.rank-1 {
    background: linear-gradient(135deg, #F59E0B, #D97706);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.rank-2 {
    background: linear-gradient(135deg, #94A3B8, #64748B);
    box-shadow: 0 2px 8px rgba(148, 163, 184, 0.4);
}

.rank-3 {
    background: linear-gradient(135deg, #CD7F32, #A0522D);
    box-shadow: 0 2px 8px rgba(205, 127, 50, 0.4);
}

.rank-number {
    font-size: 14px;
    font-weight: 700;
    color: #94A3B8;
}

.player-name {
    font-weight: 700;
    color: #1E293B;
}

.pvp-score {
    font-weight: 800;
    color: #4A90D9;
}

/* Expand Button */
.ranking-expand-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    background: transparent;
    border: none;
    border-top: 1px solid #F1F5F9;
    color: #4A90D9;
    font-size: 14px;
    font-weight: 700;
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ranking-expand-btn:hover {
    background: #F8FAFC;
    color: #3B7DD8;
}

/* Empty */
.ranking-empty {
    text-align: center;
    padding: 40px 24px;
    background: #fff;
    border: 2px dashed #E2E8F0;
    border-radius: 16px;
    color: #64748B;
    font-size: 15px;
}

/* Pagina /rankings */
.ranking-server-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 24px;
}

.ranking-server-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    background: #fff;
    color: #64748B;
    border: 2px solid #E2E8F0;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
}

.ranking-server-tab:hover {
    border-color: #94A3B8;
    color: #334155;
    transform: translateY(-2px);
}

.ranking-server-tab.active {
    background: linear-gradient(135deg, #3B82F6, #2563EB);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.ranking-server-tab-new {
    padding: 2px 8px;
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: #fff;
    border-radius: 50px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rankings-page-table {
    max-width: 720px;
    margin: 0 auto;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .server-content-layout {
        flex-direction: column;
    }

    .server-ranking-col {
        width: 100%;
        position: static;
    }

    .character-card-new {
        flex-direction: column;
    }

    .char-avatar {
        width: 100%;
        min-height: 140px;
    }

    .char-avatar-layers {
        width: 100px;
        height: 120px;
    }

    .char-stats {
        flex-wrap: wrap;
        gap: 12px;
    }

    .char-actions {
        flex-direction: column;
    }

    .ddt-btn-play-server,
    .ddt-btn-recharge,
    .ddt-btn-actions {
        justify-content: center;
        text-align: center;
    }
}
