/**
 * Sistema de Desafios (Salas tipo Poker) - FynixGlobal
 * Estilos do modal, lobby, partidas e componentes
 */

/* ================================
   MODAL DO LOBBY
   ================================ */
.challenges-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.challenges-modal.show {
    display: flex;
    opacity: 1;
}

.challenges-modal-content {
    width: 95%;
    max-width: 900px;
    max-height: 90vh;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5), 0 0 40px rgba(0, 200, 100, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Header do Modal */
.challenges-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(90deg, #0f3443 0%, #34e89e20 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.challenges-tabs {
    display: flex;
    gap: 5px;
}

.challenges-tab {
    padding: 10px 20px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.challenges-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.challenges-tab.active {
    background: linear-gradient(135deg, #00c853, #00e676);
    color: #000;
}

.challenges-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.challenges-close:hover {
    background: #ff4757;
    transform: rotate(90deg);
}

/* Body do Modal */
.challenges-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.challenges-tab-content {
    display: none;
}

.challenges-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ================================
   BARRA DE ESTATÍSTICAS
   ================================ */
.challenges-stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.challenges-stat {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.challenges-stat .label {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.challenges-stat .value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #00e676;
}

/* ================================
   FILTROS
   ================================ */
.challenges-filter {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.filter-btn.active {
    background: linear-gradient(135deg, #00c853, #00e676);
    color: #000;
    border-color: transparent;
}

/* ================================
   LISTA DE SALAS
   ================================ */
.challenges-rooms-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.room-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.room-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #00c853, #00e676);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.room-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 200, 100, 0.2);
    border-color: rgba(0, 200, 100, 0.3);
}

.room-card:hover::before {
    opacity: 1;
}

.room-card.has-matches {
    border-color: rgba(255, 107, 107, 0.3);
}

.room-card.has-matches::before {
    background: linear-gradient(90deg, #ff6b6b, #ee5a5a);
    opacity: 1;
}

.room-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.room-type {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.badge {
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge.rapid {
    background: linear-gradient(135deg, #f39c12, #e74c3c);
    color: #fff;
}

.badge.demo {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: #fff;
}

.room-name {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 15px;
}

.room-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.room-details .detail {
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 12px;
    border-radius: 8px;
}

.room-details .label {
    display: block;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    margin-bottom: 2px;
}

.room-details .value {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.room-details .value.demo {
    color: #3498db;
}

.room-status {
    margin-bottom: 15px;
    min-height: 20px;
}

.room-status span {
    display: inline-block;
    font-size: 11px;
    margin-right: 10px;
}

.active-matches {
    color: #ff6b6b;
}

.queue-size {
    color: #f39c12;
}

.room-join-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #00c853, #00e676);
    border: none;
    border-radius: 10px;
    color: #000;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.room-join-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 20px rgba(0, 200, 100, 0.4);
}

/* ================================
   PARTIDAS AO VIVO
   ================================ */
.challenges-live-header,
.challenges-ranking-header,
.challenges-history-header {
    text-align: center;
    margin-bottom: 20px;
}

.challenges-live-header h3,
.challenges-ranking-header h3,
.challenges-history-header h3 {
    font-size: 24px;
    color: #fff;
    margin-bottom: 5px;
}

.challenges-live-header p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

.live-match-card {
    background: linear-gradient(135deg, rgba(255,107,107,0.1) 0%, rgba(255,107,107,0.05) 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 107, 107, 0.2);
    position: relative;
}

.live-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #ff4757;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.match-room {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
}

.match-details {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
}

.btn-watch {
    padding: 10px 25px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-watch:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

/* ================================
   RANKING
   ================================ */
.ranking-table {
    width: 100%;
    border-collapse: collapse;
}

.ranking-table th,
.ranking-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ranking-table th {
    background: rgba(0, 0, 0, 0.3);
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ranking-table td {
    color: #fff;
    font-size: 14px;
}

.ranking-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.ranking-table tr.is-me {
    background: rgba(0, 200, 100, 0.1);
}

.ranking-table tr.is-me td {
    color: #00e676;
    font-weight: 600;
}

.ranking-table .positive {
    color: #00e676;
}

.ranking-table .negative {
    color: #ff6b6b;
}

/* ================================
   HISTÓRICO
   ================================ */
.history-card {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 10px;
    border-left: 4px solid transparent;
}

.history-card.win {
    border-left-color: #00e676;
    background: rgba(0, 230, 118, 0.05);
}

.history-card.loss {
    border-left-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.05);
}

.history-result {
    font-size: 24px;
}

.history-info {
    flex: 1;
}

.history-info .room-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 3px;
}

.history-info .match-date {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.history-profit {
    font-size: 16px;
    font-weight: 700;
}

.history-profit.positive {
    color: #00e676;
}

.history-profit.negative {
    color: #ff6b6b;
}

/* ================================
   PAINEL DA PARTIDA
   ================================ */
.challenge-match-panel {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 320px;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 16px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 9999;
    overflow: hidden;
    transition: all 0.3s ease;
}

.challenge-match-panel.minimized .match-panel-body {
    display: none;
}

.match-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: linear-gradient(90deg, #0f3443 0%, #34e89e20 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.match-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.match-room-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.match-timer {
    font-size: 20px;
    font-weight: 700;
    color: #00e676;
    font-family: monospace;
}

.match-timer.urgent {
    color: #ff6b6b;
    animation: blink 0.5s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.match-goal {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.match-goal strong {
    color: #ffd700;
}

.btn-minimize {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-minimize:hover {
    background: rgba(255, 255, 255, 0.2);
}

.match-panel-body {
    padding: 15px;
}

.my-balance {
    text-align: center;
    padding: 15px;
    background: rgba(0, 200, 100, 0.1);
    border-radius: 12px;
    margin-bottom: 15px;
}

.my-balance .label {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    margin-bottom: 5px;
}

.my-balance .value {
    font-size: 28px;
    font-weight: 700;
    color: #00e676;
}

/* Participantes */
.participants-list {
    margin-bottom: 15px;
}

.participant {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 5px;
}

.participant.is-me {
    background: rgba(0, 200, 100, 0.1);
    border: 1px solid rgba(0, 200, 100, 0.3);
}

.participant-rank {
    width: 30px;
    text-align: center;
    font-size: 16px;
}

.participant-info {
    flex: 1;
}

.participant-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

.participant-balance {
    display: block;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.participant-profit {
    font-size: 12px;
    font-weight: 600;
}

.participant-profit.positive {
    color: #00e676;
}

.participant-profit.negative {
    color: #ff6b6b;
}

/* Controles de Trade */
.match-trade-controls {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
}

.trade-amount-control {
    margin-bottom: 15px;
}

.trade-amount-control label {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 8px;
    text-transform: uppercase;
}

.amount-buttons {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
}

.amount-buttons button {
    flex: 1;
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.amount-buttons button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.amount-buttons button.active {
    background: linear-gradient(135deg, #00c853, #00e676);
    color: #000;
    border-color: transparent;
}

#challenge-trade-amount {
    width: 100%;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    text-align: center;
}

.trade-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.btn-call, .btn-put {
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-call {
    background: linear-gradient(135deg, #00c853, #00e676);
    color: #000;
}

.btn-put {
    background: linear-gradient(135deg, #ff4757, #ff6b6b);
    color: #fff;
}

.btn-call:hover, .btn-put:hover {
    transform: scale(1.02);
}

.btn-call.disabled, .btn-put.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-call .arrow, .btn-put .arrow {
    font-size: 20px;
}

/* Ações */
.match-actions {
    text-align: center;
}

.btn-forfeit {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid rgba(255, 107, 107, 0.5);
    border-radius: 8px;
    color: #ff6b6b;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-forfeit:hover {
    background: rgba(255, 107, 107, 0.1);
}

/* Tela de espera */
.waiting-opponent {
    text-align: center;
    padding: 30px;
}

.waiting-animation {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
}

.pulse-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid #00e676;
    animation: pulseRing 1.5s infinite;
}

@keyframes pulseRing {
    0% { transform: scale(0.8); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

.waiting-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 40px;
}

.waiting-opponent h3 {
    color: #fff;
    margin-bottom: 10px;
}

.waiting-opponent p {
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 20px;
}

.btn-cancel {
    padding: 10px 25px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Progresso do Trade */
.trade-progress {
    text-align: center;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 15px;
}

.trade-progress.call {
    background: rgba(0, 200, 100, 0.1);
    border: 1px solid rgba(0, 200, 100, 0.3);
}

.trade-progress.put {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
}

.trade-direction {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
}

.trade-progress.call .trade-direction {
    color: #00e676;
}

.trade-progress.put .trade-direction {
    color: #ff6b6b;
}

.trade-amount {
    font-size: 18px;
    color: #fff;
    margin-bottom: 15px;
}

.trade-timer {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00c853, #00e676);
    transition: width 0.1s linear;
}

.trade-progress.put .progress-fill {
    background: linear-gradient(90deg, #ff4757, #ff6b6b);
}

.time-left {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    min-width: 40px;
}

/* ================================
   RESULTADO DA PARTIDA
   ================================ */
.match-result-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10001;
    display: flex;
    justify-content: center;
    align-items: center;
}

.match-result-modal {
    text-align: center;
    padding: 40px;
    animation: resultPopIn 0.5s ease;
}

@keyframes resultPopIn {
    0% { transform: scale(0.5); opacity: 0; }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.result-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: bounce 0.5s ease infinite alternate;
}

@keyframes bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-10px); }
}

.match-result-modal h2 {
    font-size: 48px;
    margin-bottom: 10px;
}

.match-result-overlay.winner h2 {
    color: #ffd700;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

.match-result-overlay.loser h2 {
    color: #ff6b6b;
}

.match-result-modal p {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 15px;
}

.result-reason {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 20px;
}

.result-profit {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 30px;
}

.result-profit.positive {
    color: #00e676;
}

.result-profit.negative {
    color: #ff6b6b;
}

.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.result-actions .btn-primary {
    padding: 15px 30px;
    background: linear-gradient(135deg, #00c853, #00e676);
    border: none;
    border-radius: 10px;
    color: #000;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.result-actions .btn-secondary {
    padding: 15px 30px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.result-actions .btn-primary:hover,
.result-actions .btn-secondary:hover {
    transform: scale(1.05);
}

/* ================================
   NOTIFICAÇÕES
   ================================ */
.challenge-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    z-index: 10002;
    transition: transform 0.3s ease;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.challenge-notification.show {
    transform: translateX(-50%) translateY(0);
}

.challenge-notification.success {
    background: linear-gradient(135deg, #00c853, #00e676);
    color: #000;
}

.challenge-notification.error {
    background: linear-gradient(135deg, #ff4757, #ff6b6b);
    color: #fff;
}

.challenge-notification.warning {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: #fff;
}

.challenge-notification.info {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: #fff;
}

/* ================================
   CONFETTI
   ================================ */
.confetti-piece {
    position: fixed;
    top: -20px;
    width: 10px;
    height: 10px;
    z-index: 10003;
    animation: confettiFall linear forwards;
}

@keyframes confettiFall {
    to {
        top: 100vh;
        transform: rotate(720deg);
    }
}

/* ================================
   RESPONSIVO
   ================================ */
@media (max-width: 768px) {
    .challenges-modal-content {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    
    .challenges-tabs {
        flex-wrap: wrap;
    }
    
    .challenges-tab {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .challenges-stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .challenges-rooms-list {
        grid-template-columns: 1fr;
    }
    
    .challenge-match-panel {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 20px 20px 0 0;
    }
    
    .trade-buttons {
        grid-template-columns: 1fr 1fr;
    }
}

/* ================================
   UTILITÁRIOS
   ================================ */
.loading {
    text-align: center;
    padding: 40px;
    color: rgba(255, 255, 255, 0.5);
}

.empty {
    text-align: center;
    padding: 40px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

.error {
    text-align: center;
    padding: 40px;
    color: #ff6b6b;
}

/* ===== TELA DE FILA ===== */
.challenge-match-panel.queue-mode {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.queue-info {
    text-align: center;
    padding: 20px;
}

.queue-animation {
    margin-bottom: 20px;
}

.queue-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.queue-dots span {
    width: 12px;
    height: 12px;
    background: #ffd700;
    border-radius: 50%;
    animation: queuePulse 1.4s infinite ease-in-out both;
}

.queue-dots span:nth-child(1) { animation-delay: -0.32s; }
.queue-dots span:nth-child(2) { animation-delay: -0.16s; }
.queue-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes queuePulse {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.queue-info h3 {
    color: #ffd700;
    font-size: 18px;
    margin-bottom: 10px;
}

.queue-position {
    font-size: 24px;
    color: #fff;
    margin: 15px 0;
}

.queue-position strong {
    color: #00e676;
    font-size: 32px;
}

.queue-message {
    color: #8A94A7;
    font-size: 14px;
    margin-bottom: 20px;
}

.btn-cancel-queue {
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-cancel-queue:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

/* ==================== CHAT DO LOBBY ==================== */
.lobby-chat-container {
    display: flex;
    flex-direction: column;
    height: 400px;
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    overflow: hidden;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: rgba(0,200,150,0.2);
    border-bottom: 1px solid rgba(0,200,150,0.3);
}

.chat-header span:first-child {
    font-weight: 600;
    color: #00c896;
}

.chat-status {
    font-size: 12px;
    color: #4ade80;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-welcome {
    text-align: center;
    color: #888;
    font-size: 12px;
    padding: 10px;
    font-style: italic;
}

.chat-message {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 8px 12px;
    border-radius: 8px;
    max-width: 85%;
    font-size: 13px;
}

.chat-message.my-message {
    background: rgba(0,200,150,0.2);
    margin-left: auto;
    border: 1px solid rgba(0,200,150,0.3);
}

.chat-message.other-message {
    background: rgba(255,255,255,0.05);
    margin-right: auto;
    border: 1px solid rgba(255,255,255,0.1);
}

.chat-username {
    font-weight: 600;
    color: #00c896;
    font-size: 11px;
    width: 100%;
}

.chat-message.my-message .chat-username {
    text-align: right;
}

.chat-text {
    color: #fff;
    word-break: break-word;
}

.chat-time {
    font-size: 10px;
    color: #666;
    margin-left: auto;
}

.chat-input-area {
    display: flex;
    gap: 10px;
    padding: 10px;
    background: rgba(0,0,0,0.3);
    border-top: 1px solid rgba(255,255,255,0.1);
}

.chat-input-area input {
    flex: 1;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    padding: 10px 15px;
    color: #fff;
    font-size: 13px;
}

.chat-input-area input:focus {
    outline: none;
    border-color: #00c896;
}

.chat-input-area button {
    background: linear-gradient(135deg, #00c896, #00a67d);
    border: none;
    border-radius: 20px;
    padding: 10px 20px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.chat-input-area button:hover {
    transform: scale(1.05);
}

/* ==================== CHAT DA PARTIDA (Mini) ==================== */
.match-chat-container {
    background: rgba(0,0,0,0.4);
    border-radius: 8px;
    margin-top: 10px;
    overflow: hidden;
}

.chat-header-mini {
    padding: 8px 12px;
    background: rgba(0,200,150,0.15);
    font-size: 12px;
    font-weight: 600;
    color: #00c896;
}

.chat-messages-mini {
    height: 120px;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.chat-messages-mini .chat-message {
    padding: 5px 8px;
    font-size: 12px;
    max-width: 90%;
}

.chat-messages-mini .chat-username {
    font-size: 10px;
}

.chat-input-mini {
    display: flex;
    gap: 5px;
    padding: 8px;
    background: rgba(0,0,0,0.3);
}

.chat-input-mini input {
    flex: 1;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 15px;
    padding: 6px 12px;
    color: #fff;
    font-size: 12px;
}

.chat-input-mini button {
    background: #00c896;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
}

/* ==================== COMO FUNCIONA ==================== */
.how-it-works {
    padding: 20px;
    color: #fff;
}

.how-it-works h3 {
    text-align: center;
    margin-bottom: 25px;
    color: #00c896;
    font-size: 22px;
}

.how-it-works .section {
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 15px;
    border-left: 3px solid #00c896;
}

.how-it-works .section h4 {
    color: #00c896;
    margin-bottom: 10px;
    font-size: 16px;
}

.how-it-works .section p {
    color: #ccc;
    margin-bottom: 10px;
    line-height: 1.5;
}

.how-it-works .section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.how-it-works .section ul li {
    padding: 5px 0;
    color: #aaa;
    padding-left: 20px;
    position: relative;
}

.how-it-works .section ul li:before {
    content: '•';
    color: #00c896;
    position: absolute;
    left: 5px;
}

/* Scrollbar customizada para o chat */
.chat-messages::-webkit-scrollbar,
.chat-messages-mini::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track,
.chat-messages-mini::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2);
}

.chat-messages::-webkit-scrollbar-thumb,
.chat-messages-mini::-webkit-scrollbar-thumb {
    background: #00c896;
    border-radius: 3px;
}

/* ==================== DESAFIO DIRETO ==================== */

/* Botão Desafiar no Ranking */
.btn-desafiar {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    border: none;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-desafiar:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4);
}

.voce-tag {
    color: #00c896;
    font-size: 11px;
    font-weight: 600;
}

/* Modal de Criar Desafio */
.desafio-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.desafio-modal {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 16px;
    max-width: 420px;
    width: 100%;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}

.desafio-modal-header {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.desafio-modal-header h3 {
    color: #fff;
    margin: 0;
    font-size: 18px;
}

.desafio-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
}

.desafio-modal-body {
    padding: 20px;
}

.desafio-intro {
    color: #888;
    font-size: 14px;
    margin-bottom: 20px;
    text-align: center;
}

.desafio-field {
    margin-bottom: 15px;
}

.desafio-field label {
    display: block;
    color: #888;
    font-size: 12px;
    margin-bottom: 6px;
}

.desafio-field select,
.desafio-field input {
    width: 100%;
    padding: 12px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
}

.desafio-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.desafio-warning {
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.3);
    border-radius: 8px;
    padding: 12px;
    color: #fca5a5;
    font-size: 12px;
    margin-top: 15px;
}

.desafio-modal-footer {
    padding: 20px;
    display: flex;
    gap: 10px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.btn-cancelar {
    flex: 1;
    padding: 14px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}

.btn-enviar-desafio {
    flex: 2;
    padding: 14px;
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

/* Popup de Desafio Recebido */
.desafio-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.desafio-popup {
    background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1a 100%);
    border-radius: 20px;
    max-width: 400px;
    width: 100%;
    overflow: hidden;
    border: 2px solid #dc2626;
    box-shadow: 0 0 60px rgba(220, 38, 38, 0.3);
    animation: popIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.desafio-popup-header {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    padding: 25px;
    text-align: center;
}

.desafio-popup-header h2 {
    color: #fff;
    margin: 0;
    font-size: 24px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.desafio-popup-body {
    padding: 25px;
    text-align: center;
}

.desafiante-nome {
    font-size: 28px;
    font-weight: 700;
    color: #dc2626;
    margin: 0 0 5px 0;
}

.desafiante-texto {
    color: #888;
    font-size: 14px;
    margin: 0 0 20px 0;
}

.desafio-detalhes {
    background: rgba(0,0,0,0.3);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
}

.desafio-detalhes .detalhe {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 14px;
}

.desafio-detalhes .detalhe:last-child {
    border-bottom: none;
}

.desafio-detalhes .detalhe span {
    color: #888;
}

.desafio-detalhes .detalhe strong {
    color: #fff;
}

.desafio-detalhes .detalhe strong.valor {
    color: #dc2626;
}

.desafio-provocacao {
    color: #f59e0b;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.desafio-popup-footer {
    padding: 20px;
    display: flex;
    gap: 10px;
}

.btn-recusar {
    flex: 1;
    padding: 16px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 10px;
    color: #888;
    font-size: 14px;
    cursor: pointer;
}

.btn-aceitar {
    flex: 2;
    padding: 16px;
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-aceitar:hover {
    box-shadow: 0 5px 25px rgba(220, 38, 38, 0.5);
}

@keyframes popIn {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
