:root{
    --grad-primary: linear-gradient(145deg, #7C6CF6 0%, #6E43D4 55%, #4B7BEB 100%);
    --grad-gold: linear-gradient(145deg, #FFD24A 0%, #FFA312 65%, #FF7414 100%);
    --grad-success-soft: linear-gradient(145deg, #1dd667 0%, #16a34a 100%);
    --grad-danger-soft: linear-gradient(145deg, #ce2449 0%, #9F1239 100%);
}

.alert-login {
  margin: 8px 0;
  padding: 14px 16px;
  border-radius: 0.9rem;
  border: 1px solid color-mix(in srgb, var(--bs-warning) 35%, var(--share-border));
  background: color-mix(in srgb, var(--bs-warning) 14%, transparent);
}

.ad-label {
    color: var(--bs-gray-600);
    font-size: 0.875rem;
    margin-bottom: 10px;
}

.ad-placeholder {
    background: var(--bs-body-bg);
    border-radius: 8px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--bs-border-color);
    margin: 0 auto;
}

.ad-desktop {
    height: 90px;
    width: 728px;
}

.ad-mobile {
    height: 150px;
    width: 320px;
}

.ad-placeholder span {
    color: var(--bs-gray-600);
}

@media (max-width: 768px) {
    .ad-mobile {
        width: 100%;
        max-width: 320px;
    }
}

.hero-quiz-badge {
    background: linear-gradient(145deg, #FFD24A 0%, #FFA312 65%, #FF7414 100%);
    color: #1f2937;
    border: none;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Badge para título do desafio */
.hero-title-badge {
    background: linear-gradient(145deg, 
        rgba(255, 255, 255, 0.95) 0%,
        rgba(255, 255, 255, 0.90) 100%
    );
    color: #1f2937 !important;
    border: 2px solid rgba(255, 255, 255, 0.3);
    font-weight: 700;
    letter-spacing: 0.3px;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.2),
        inset 0 0 20px rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
    max-width: 90%;
    word-wrap: break-word;
    white-space: normal;
    text-align: center;
    line-height: 1.4;
}

/* Versão com gradiente colorido (alternativa) */
.hero-title-badge-gradient {
    background: linear-gradient(145deg, 
        #FF6B6B 0%,
        #FFA500 25%,
        #FFD93D 50%,
        #6BCF7F 75%,
        #4D96FF 100%
    );
    color: #1f2937 !important;
    border: 2px solid rgba(255, 255, 255, 0.4);
    font-weight: 700;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.hero-title-badge-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        transparent 30%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 70%
    );
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Ajustes para mobile */
@media (max-width: 767.98px) {
    .hero-title-badge {
        font-size: 0.9rem !important;
        padding: 0.75rem 1rem !important;
        max-width: 95%;
        margin: 0.5rem 0 !important;
    }
    
    .hero-title-badge i {
        font-size: 1.25rem !important;
        margin-right: 0.5rem !important;
    }
    
    /* Reduz truncamento no mobile */
    .hero-title-badge {
        max-width: 95%;
    }

    .hero-play-btn{
        padding: 10px 18px;
        font-size: 0.95rem;
    }
}

/* Para telas muito pequenas */
@media (max-width: 375px) {
    .hero-title-badge {
        font-size: 0.8rem !important;
        padding: 0.5rem 0.75rem !important;
        max-width: 100%;
    }
    
    .hero-title-badge i {
        font-size: 1rem !important;
        margin-right: 0.35rem !important;
    }
}

.hero-play-btn{
    position: relative;
    overflow: hidden;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    padding: 12px 26px;
    border-radius: 999px;

    text-decoration: none;
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.2px;

    background: var(--grad-primary);
    box-shadow:
        0 10px 25px rgba(110, 67, 212, 0.35),
        inset 0 0 0 1px rgba(255,255,255,0.22);

    transition: all 0.3s ease;
}

.hero-play-btn i{
    color: #ebeaea;
    line-height: 1;
}

.hero-play-btn::before{
    content:"";
    position:absolute;
    inset:-45%;
    z-index:0;

    background:
        radial-gradient(60% 55% at 30% 15%, #7C6CF6 0%, transparent 65%),
        radial-gradient(55% 55% at 20% 85%, #6E43D4 0%, transparent 68%),
        radial-gradient(50% 50% at 80% 70%, #4B7BEB 0%, transparent 70%);

    filter: blur(45px);
    transform: scale(1.1);
    pointer-events:none;
}

.hero-play-btn > *{
    position: relative;
    z-index: 1;
}

.hero-play-btn:hover{
    transform: translateY(-2px);
    filter: brightness(1.06);
    box-shadow:
        0 16px 35px rgba(110, 67, 212, 0.55),
        inset 0 0 0 1px rgba(255,255,255,0.32);
}

/* Transições */
.transition-ease-in-out {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Destaque do usuário atual */
.highlight-row {
    position: relative;
    box-shadow: 0 0 20px rgba(25, 135, 84, 0.1);
}

.highlight-row::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to bottom, var(--bs-success), var(--bs-success-dark));
    border-radius: 2px;
}

/* ===============================
   Badges / Stats
   =============================== */

.position-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 100px;
}

/* SCORE (Placar geral) */
.score-badge {
    background: var(--grad-primary) !important;
    color: #ffffff !important;
    border-radius: 12px;
    display: inline-block;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.2px;
    box-shadow: 0 10px 22px rgba(110, 67, 212, 0.25);
}

.score-badge::before {
    content:"";
    position:absolute;
    inset:-40%;
    background: radial-gradient(circle at top left, rgba(255,255,255,0.30), transparent 60%);
    filter: blur(20px);
    pointer-events:none;
}

/* TEMPO (Tempo méd.) */
.time-badge {
    background: var(--grad-gold) !important;
    color: #1f2937 !important;
    border-radius: 12px;
    display: inline-block;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 22px rgba(255, 178, 36, 0.25);
}

.time-badge::before{
    content:"";
    position:absolute;
    inset:-40%;
    background: radial-gradient(circle at top left, rgba(255,255,255,0.55), transparent 60%);
    filter: blur(18px);
    pointer-events:none;
}

/* JOGOS */
.badge.badge-light-info {
    background: rgba(124, 108, 246, 0.12) !important;
    color: #6E43D4 !important;
    border: 1px solid rgba(124, 108, 246, 0.20) !important;
    border-radius: 12px;
}

/* ===============================
   Tabela moderna
   =============================== */

.table {
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(var(--bs-light-rgb), 0.5);
}

.table-hover tbody tr:hover {
    background-color: rgba(124, 108, 246, 0.06) !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(110, 67, 212, 0.10);
}

/* ===============================
   Barra de progresso de precisão
   =============================== */

.accuracy-progress {
    background-color: var(--bs-gray-200);
    border-radius: 999px;
    overflow: hidden;
}

.accuracy-progress .progress-bar {
    border-radius: 999px;
    transition: width 0.6s ease;
    background: linear-gradient(
        90deg,
        #ec7fde 0%,
        #ffa312 55%,
        #ffd24a 100%
    ) !important;
}

.accuracy-progress .progress-bar.bg-success { background: var(--grad-success-soft) !important; }
.accuracy-progress .progress-bar.bg-info    { background: var(--grad-primary) !important; }
.accuracy-progress .progress-bar.bg-warning { background: var(--grad-gold) !important; }
.accuracy-progress .progress-bar.bg-danger  { background: var(--grad-danger-soft) !important; }

/* ===============================
   Avatar com borda dinâmica
   =============================== */

.symbol-label {
    transition: all 0.3s ease;
    overflow: hidden;
}

.symbol-label.border-warning {
    border-color: var(--bs-warning) !important;
    box-shadow: 0 0 0 1px rgba(var(--bs-warning-rgb), 0.2);
}

.symbol-label.border-brown {
    border-color: #a52a2a !important;
    box-shadow: 0 0 0 1px rgba(165, 42, 42, 0.2);
}

/* ===============================
   Animações
   =============================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(var(--bs-success-rgb), 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(var(--bs-success-rgb), 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(var(--bs-success-rgb), 0);
    }
}

.ranking-row {
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
}

/* Delay para as animações */
.ranking-row:nth-child(1) { animation-delay: 0.1s; }
.ranking-row:nth-child(2) { animation-delay: 0.2s; }
.ranking-row:nth-child(3) { animation-delay: 0.3s; }
.ranking-row:nth-child(4) { animation-delay: 0.4s; }
.ranking-row:nth-child(5) { animation-delay: 0.5s; }
.ranking-row:nth-child(6) { animation-delay: 0.6s; }
.ranking-row:nth-child(7) { animation-delay: 0.7s; }
.ranking-row:nth-child(8) { animation-delay: 0.8s; }
.ranking-row:nth-child(9) { animation-delay: 0.9s; }
.ranking-row:nth-child(10){ animation-delay: 1.0s; }

/* Efeito de pulso para o usuário atual */
.highlight-row {
    animation: pulse 2s infinite;
}

/* Bronze */
.border-bronze { border-color: #bc7337 !important; }
.text-bronze { color: #bc7337 !important; }
.bg-bronze { background-color: #bc7337 !important; }

/* Corrige o bronze opacity */
.bg-bronze.bg-opacity-10 {
    background-color: rgba(188, 115, 55, 0.16) !important;
    border: 1px solid rgba(188, 115, 55, 0.25);
}

/* Ajusta TOP 1/2/3 */
.position-badge.bg-warning.bg-opacity-10 {
    background: rgba(255, 178, 36, 0.16) !important;
    border: 1px solid rgba(255, 178, 36, 0.25);
}

.position-badge.bg-gray-200 {
    background: rgba(148,163,184,0.25) !important;
    border: 1px solid rgba(148,163,184,0.35);
}

/* ===============================
   CARD VIEW PARA MOBILE
   =============================== */

.ranking-card {
    background: var(--bs-card-bg);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid var(--bs-border-color);
    transition: all 0.3s ease;
}

.ranking-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.ranking-card.highlight-row {
    border-left: 4px solid var(--bs-success);
    background: rgba(25, 135, 84, 0.03);
}

.ranking-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.ranking-card-position {
    font-size: 1.5rem;
    font-weight: bold;
    min-width: 40px;
    text-align: center;
}

.ranking-card-body {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    font-size: 0.875rem;
}

.ranking-card-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0.5rem;
    background: rgba(var(--bs-light-rgb), 0.5);
    border-radius: 8px;
}

.ranking-card-stat-label {
    font-size: 0.75rem;
    color: var(--bs-gray-600);
    margin-bottom: 0.25rem;
}

.ranking-card-stat-value {
    font-weight: bold;
    font-size: 1rem;
}

/* Estilos para os badges mobile */
.score-badge-sm {
    background: var(--grad-primary) !important;
    color: #ffffff !important;
    border-radius: 8px;
    padding: 0.3rem 0.6rem;
    font-size: 0.9rem;
    display: inline-block;
    min-width: 60px;
    text-align: center;
}

.time-badge-sm {
    background: var(--grad-gold) !important;
    color: #1f2937 !important;
    border-radius: 8px;
    padding: 0.3rem 0.6rem;
    font-size: 0.9rem;
    display: inline-block;
    min-width: 60px;
    text-align: center;
}

.games-badge-sm {
    background: rgba(124, 108, 246, 0.12) !important;
    color: #6E43D4 !important;
    border: 1px solid rgba(124, 108, 246, 0.20);
    border-radius: 8px;
    padding: 0.3rem 0.6rem;
    font-size: 0.9rem;
    display: inline-block;
    min-width: 60px;
    text-align: center;
}

.accuracy-progress-sm {
    background-color: var(--bs-gray-200);
    border-radius: 999px;
    overflow: hidden;
}

.accuracy-progress-sm .progress-bar {
    border-radius: 999px;
    background: linear-gradient(
        90deg,
        #ec7fde 0%,
        #ffa312 55%,
        #ffd24a 100%
    ) !important;
}

/* ===============================
   RESPONSIVIDADE
   =============================== */

/* Desktop: mostra tabela, esconde cards */
@media (min-width: 768px) {
    .ranking-table-mobile-view {
        display: table !important;
    }
    
    .ranking-card-mobile-view {
        display: none !important;
    }
}

/* Mobile: mostra cards, esconde tabela */
@media (max-width: 767.98px) {
    .card .card-body {
        padding: 1rem !important;
    }
    .ranking-table-mobile-view {
        display: none !important;
    }
    
    .ranking-card-mobile-view {
        display: block !important;
    }
    
    /* Header mobile */
    .card-header {
        padding: 1rem !important;
    }
    
    .card-title .card-label {
        font-size: 1.4rem !important;
        text-align: center;
        display: block;
        margin-bottom: 1rem;
    }
    
    #searchPlayer {
        width: 100% !important;
        font-size: 0.9rem;
    }
    
    /* Cards mobile ajustes */
    .ranking-card {
        padding: 0.75rem;
    }
    
    .symbol-50px {
        width: 40px !important;
        height: 40px !important;
    }
    
    .ranking-card-position {
        font-size: 1.25rem;
        min-width: 35px;
    }
    
    .ranking-card-body {
        gap: 0.5rem;
    }
    
    .ranking-card-stat {
        padding: 0.4rem;
    }
    
    /* Anúncio mobile */
    .ad-card-mobile .ad-placeholder.ad-mobile {
        width: 100% !important;
        max-width: 300px;
        height: 120px;
    }
}

/* Mobile muito pequeno */
@media (max-width: 375px) {
    .ranking-card-header {
        gap: 0.75rem;
    }
    
    .symbol-50px {
        width: 35px !important;
        height: 35px !important;
    }
    
    .ranking-card-body {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .score-badge-sm,
    .time-badge-sm,
    .games-badge-sm {
        min-width: 50px;
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }
}

/* ===============================
   TABLET / iPAD (ajuste fino)
   768px até 1024px (inclui iPad)
   =============================== */
@media (min-width: 768px) and (max-width: 1024px) {

  /* Container um pouco mais “cheio” pra tabela respirar */
  #kt_app_content_container {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  /* Header: título + busca mais compactos */
  .card-header .card-title .card-label {
    font-size: 1.6rem !important;
    line-height: 1.15;
  }

  #searchPlayer {
    width: 260px !important;
    font-size: 0.95rem;
  }

  /* Tabela: reduz densidade e evita “estourar” */
  .ranking-table-mobile-view th,
  .ranking-table-mobile-view td {
    padding: 0.85rem 0.6rem !important;
    font-size: 0.92rem;
    vertical-align: middle;
    white-space: nowrap;
  }

  /* Colunas: reduz min-widths para caber em iPad */
  #rankingTable th.min-w-250px { min-width: 210px !important; }
  #rankingTable th.min-w-120px { min-width: 95px !important; }
  #rankingTable th.min-w-100px { min-width: 80px !important; }
  #rankingTable th.min-w-70px  { min-width: 60px !important; }

  /* Badge de posição mais compacto */
  .position-badge {
    min-width: 76px !important;
    padding: 6px 10px !important;
    border-radius: 10px !important;
  }
  .position-badge .fs-4 { font-size: 1rem !important; }

  .symbol .symbol-label {
    width: 50px;
    height: 50px;
  }

  /* Nome do jogador: evita ocupar demais */
  .text-gray-900.fw-bold.fs-5 {
    font-size: 0.98rem !important;
  }

  /* Badges de score/tempo mais compactos */
  .score-badge {
    padding: 0.45rem 0.85rem !important;
    font-size: 1rem !important;
    border-radius: 10px !important;
  }

  .time-badge {
    padding: 0.4rem 0.75rem !important;
    font-size: 0.92rem !important;
    border-radius: 10px !important;
  }

  .badge.badge-light-info {
    padding: 0.4rem 0.7rem !important;
    font-size: 0.9rem !important;
    border-radius: 10px !important;
  }

  /* Barra de precisão um pouco menor */
  .accuracy-progress.w-100px {
    width: 86px !important;
  }
  .accuracy-progress {
    height: 7px !important;
  }

  /* “Tempo méd.” e outros textos menores */
  #rankingTable td .fw-semibold.fs-6,
  #rankingTable td .fw-bold.fs-6 {
    font-size: 0.9rem !important;
  }
}


/* ===============================
   Dark mode support
   =============================== */

[data-bs-theme="dark"] .badge.badge-light-info {
    background: rgba(124, 108, 246, 0.16) !important;
    color: #ffffff !important;
    border-color: rgba(255,255,255,0.18) !important;
}

[data-bs-theme="dark"] .table-hover tbody tr:hover {
    background-color: rgba(124, 108, 246, 0.10) !important;
    box-shadow: 0 10px 22px rgba(0,0,0,0.25);
}

[data-bs-theme="dark"] .ranking-card {
    background: rgba(30, 30, 40, 0.5);
    border-color: rgba(255,255,255,0.1);
}

[data-bs-theme="dark"] .ranking-card-stat {
    background: rgba(255,255,255,0.05);
}

[data-bs-theme="dark"] .ranking-card-stat-label {
    color: var(--bs-gray-400);
}