/* =====================================================================
   DueloJA — estilos globais
   ===================================================================== */
html, body { background: #0f0a1f; }
body { -webkit-tap-highlight-color: transparent; }

/* ---------- Fundo dinâmico ---------- */
.bg-layer {
    position: fixed; inset: -8% 0 -8% 0; z-index: 0;
    background-size: cover; background-position: center; background-repeat: no-repeat;
    transform: translate3d(0, 0, 0) scale(1.08);
    will-change: transform;
}
.bg-default {
    background: radial-gradient(1200px 600px at 10% 10%, #7c3aed 0%, transparent 60%),
                radial-gradient(900px 500px at 90% 20%, #db2777 0%, transparent 55%),
                radial-gradient(900px 700px at 50% 100%, #0ea5e9 0%, transparent 55%),
                #0f0a1f;
    animation: bgShift 18s ease-in-out infinite alternate;
}
@keyframes bgShift { 0% { filter: hue-rotate(0deg); } 100% { filter: hue-rotate(40deg); } }
.bg-overlay {
    position: fixed; inset: 0; z-index: 1; pointer-events: none;
    background:
        linear-gradient(180deg, rgba(15,10,31, calc(var(--overlay-opacity) * .85)) 0%,
                                rgba(15,10,31, var(--overlay-opacity)) 45%,
                                rgba(15,10,31, calc(var(--overlay-opacity) + .1)) 100%),
        radial-gradient(circle at 50% 0%, rgba(139,92,246,.18), transparent 60%);
}
.bg-orbs { position: fixed; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.bg-orbs span {
    position: absolute; width: 38vmax; height: 38vmax; border-radius: 50%;
    filter: blur(80px); opacity: .18; animation: orb 22s ease-in-out infinite;
}
.bg-orbs span:nth-child(1) { background: #8b5cf6; top: -10vmax; left: -10vmax; }
.bg-orbs span:nth-child(2) { background: #ec4899; bottom: -14vmax; right: -10vmax; animation-delay: -7s; }
.bg-orbs span:nth-child(3) { background: #f59e0b; top: 40%; left: 45%; width: 22vmax; height: 22vmax; animation-delay: -14s; opacity: .1; }
@keyframes orb { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(6vmax,4vmax) scale(1.15); } }

/* Todo conteúdo fica acima do fundo */
header, main, footer, nav { position: relative; z-index: 10; }
header.sticky { position: sticky; }
nav.fixed { position: fixed; }

/* ---------- Glassmorphism ---------- */
.glass {
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.12);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    box-shadow: 0 10px 40px -10px rgba(0,0,0,.45);
}
.glass-strong {
    background: rgba(15,10,31,.72);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
}
.card { border-radius: 1.25rem; padding: 1.25rem; }
@media (min-width: 768px) { .card { padding: 1.5rem; } }

.logo-badge {
    display: inline-flex; width: 2.2rem; height: 2.2rem; align-items: center; justify-content: center;
    border-radius: .8rem; background: linear-gradient(135deg,#8b5cf6,#ec4899);
    box-shadow: 0 0 20px rgba(236,72,153,.5);
}

/* Logo enviada pelo Super Admin (altura definida em 🎨 Aparência) */
.nav-com-logo { min-height: 4rem; padding-top: .5rem; padding-bottom: .5rem; }
.logo-img { display: block; height: var(--logo-h, 44px); width: auto; max-width: min(70vw, 460px); object-fit: contain; }
@media (max-width: 767px) { .logo-img { height: var(--logo-hm, 36px); } }

/* ---------- Navegação ---------- */
.nav-link { padding: .5rem .85rem; border-radius: .75rem; color: rgba(255,255,255,.8); transition: .2s; }
.nav-link:hover, .nav-link.ativo { background: rgba(255,255,255,.1); color: #fff; }
.bottom-link { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .55rem 0 .65rem; color: rgba(255,255,255,.65); }
.bottom-link.ativo { color: #fff; }
.bottom-link.ativo span { transform: translateY(-2px) scale(1.12); filter: drop-shadow(0 0 8px rgba(236,72,153,.8)); }
.bottom-link span { transition: .25s; }

/* ---------- Botões ---------- */
.btn-primary, .btn-secondary, .btn-ghost, .btn-success, .btn-danger, .btn-warning {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    font-weight: 700; border-radius: 1rem; padding: .85rem 1.4rem; min-height: 48px;
    transition: transform .15s ease, box-shadow .25s ease, filter .2s; cursor: pointer;
    user-select: none; position: relative; overflow: hidden;
}
.btn-sm { padding: .5rem 1rem; min-height: 38px; font-size: .875rem; border-radius: .8rem; }
.btn-xl { padding: 1.1rem 2rem; min-height: 60px; font-size: 1.15rem; border-radius: 1.25rem; }
.btn-primary { background: linear-gradient(135deg,#8b5cf6,#ec4899); color: #fff; box-shadow: 0 8px 25px -6px rgba(236,72,153,.65); }
.btn-secondary { background: linear-gradient(135deg,#0ea5e9,#6366f1); color: #fff; box-shadow: 0 8px 25px -6px rgba(14,165,233,.6); }
.btn-success { background: linear-gradient(135deg,#10b981,#22c55e); color: #fff; box-shadow: 0 8px 25px -6px rgba(16,185,129,.65); }
.btn-danger  { background: linear-gradient(135deg,#ef4444,#f43f5e); color: #fff; box-shadow: 0 8px 25px -6px rgba(244,63,94,.65); }
.btn-warning { background: linear-gradient(135deg,#f59e0b,#f97316); color: #111; box-shadow: 0 8px 25px -6px rgba(245,158,11,.65); }
.btn-ghost { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); color: #fff; padding: .5rem 1rem; min-height: 40px; }
.btn-primary:hover, .btn-secondary:hover, .btn-success:hover, .btn-danger:hover, .btn-warning:hover { transform: translateY(-2px); filter: brightness(1.1); }
.btn-ghost:hover { background: rgba(255,255,255,.16); }
.btn-primary:active, .btn-secondary:active, .btn-success:active, .btn-danger:active, .btn-ghost:active { transform: scale(.97); }
button:disabled, .btn-disabled { opacity: .45; cursor: not-allowed; transform: none !important; filter: grayscale(.4); }

/* Brilho que atravessa o botão */
.btn-shine::after {
    content: ""; position: absolute; top: 0; left: -75%; width: 50%; height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,.45), transparent);
    transform: skewX(-20deg); animation: shine 3.2s ease-in-out infinite;
}
@keyframes shine { 0% { left: -75%; } 60%,100% { left: 130%; } }
/* Pulso */
.btn-pulse { animation: pulseGlow 2.2s ease-in-out infinite; }
@keyframes pulseGlow {
    0%,100% { box-shadow: 0 0 0 0 rgba(236,72,153,.55), 0 8px 25px -6px rgba(236,72,153,.65); }
    50%     { box-shadow: 0 0 0 14px rgba(236,72,153,0), 0 8px 25px -6px rgba(236,72,153,.65); }
}

/* ---------- Formulários ---------- */
.input, .select, .textarea {
    width: 100%; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18);
    border-radius: .9rem; padding: .8rem 1rem; color: #fff; font-size: 1rem; min-height: 48px;
    transition: border .2s, box-shadow .2s, background .2s;
}
.input::placeholder, .textarea::placeholder { color: rgba(255,255,255,.45); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: #a78bfa; box-shadow: 0 0 0 4px rgba(139,92,246,.3); background: rgba(255,255,255,.12); }
.select option, .select optgroup { background: #1e1536; color: #fff; }
.label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .35rem; color: rgba(255,255,255,.85); }
input[type=file].input { padding: .6rem; }
input[type=file]::file-selector-button {
    margin-right: .8rem; border: 0; border-radius: .6rem; padding: .45rem .9rem; font-weight: 600;
    background: linear-gradient(135deg,#8b5cf6,#ec4899); color: #fff; cursor: pointer;
}
input[type=range] { accent-color: #ec4899; }

/* ---------- Tabelas ---------- */
.tabela { width: 100%; font-size: .9rem; border-collapse: separate; border-spacing: 0; }
.tabela th { text-align: left; font-weight: 600; color: rgba(255,255,255,.65); font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; padding: .6rem .75rem; border-bottom: 1px solid rgba(255,255,255,.12); }
.tabela td { padding: .75rem; border-bottom: 1px solid rgba(255,255,255,.07); vertical-align: middle; }
.tabela tr:hover td { background: rgba(255,255,255,.04); }

/* ---------- Abas admin ---------- */
.aba { white-space: nowrap; padding: .6rem 1rem; border-radius: .9rem; font-weight: 600; font-size: .9rem; color: rgba(255,255,255,.75); background: rgba(255,255,255,.05); border: 1px solid transparent; }
.aba.ativa { color: #fff; background: linear-gradient(135deg,rgba(139,92,246,.45),rgba(236,72,153,.45)); border-color: rgba(255,255,255,.2); }
.scroll-x { overflow-x: auto; scrollbar-width: none; }
.scroll-x::-webkit-scrollbar { display: none; }

/* ---------- Contadores / stat ---------- */
.stat-num { font-size: clamp(1.9rem, 5vw, 2.75rem); font-weight: 900; line-height: 1; letter-spacing: -.02em;
    background: linear-gradient(135deg,#fff,#f5d0fe); -webkit-background-clip: text; background-clip: text; color: transparent; }
.texto-gradiente { background: linear-gradient(90deg,#f0abfc,#c4b5fd,#fcd34d,#f0abfc); background-size: 300% 100%;
    -webkit-background-clip: text; background-clip: text; color: transparent; animation: gradMove 8s linear infinite; }
@keyframes gradMove { to { background-position: 300% 0; } }
.flutuar { animation: flutuar 5s ease-in-out infinite; }
@keyframes flutuar { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

/* ---------- Ranking em corrida ---------- */
.race { position: relative; }
.race-row {
    position: absolute; left: 0; right: 0; height: 64px;
    transition: transform .9s cubic-bezier(.22,1,.36,1);
}
.race-inner { display: flex; align-items: center; gap: .65rem; height: 56px; }
.race-pos { width: 2rem; text-align: center; font-weight: 800; font-size: 1.05rem; flex-shrink: 0; }
.race-avatar { position: relative; flex-shrink: 0; }
.race-avatar img, .race-avatar .ini { width: 44px; height: 44px; border-radius: 9999px; object-fit: cover; border: 2px solid rgba(255,255,255,.35); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .85rem; }
.race-medal { position: absolute; top: -12px; right: -8px; font-size: 1.15rem; filter: drop-shadow(0 2px 4px rgba(0,0,0,.6)); }
.race-track { flex: 1; min-width: 0; position: relative; height: 44px; border-radius: 9999px; background: rgba(255,255,255,.06); overflow: hidden; }
.race-bar {
    position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 9999px;
    transition: width 1.4s cubic-bezier(.22,1,.36,1);
    background-size: 200% 100%; animation: barFlow 4s linear infinite;
    box-shadow: inset 0 -3px 0 rgba(0,0,0,.18), 0 0 18px rgba(255,255,255,.08);
}
@keyframes barFlow { to { background-position: 200% 0; } }
.race-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 .9rem; gap: .5rem; font-size: .82rem; text-shadow: 0 1px 3px rgba(0,0,0,.8); }
.race-label .nome { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.race-label .cap { opacity: .85; font-size: .72rem; white-space: nowrap; }
.race-score { width: 4.5rem; text-align: right; font-weight: 800; flex-shrink: 0; font-size: .95rem; }
.race-score small { display: block; font-weight: 500; font-size: .68rem; opacity: .7; }
.race-row.top1 .race-track { box-shadow: 0 0 0 2px rgba(250,204,21,.7), 0 0 25px rgba(250,204,21,.35); }
.race-row.top2 .race-track { box-shadow: 0 0 0 2px rgba(226,232,240,.6); }
.race-row.top3 .race-track { box-shadow: 0 0 0 2px rgba(251,146,60,.6); }
.race-row.subiu .race-track { animation: subiu 1.6s ease; }
.race-row.subiu .race-pos::after { content: "▲"; color: #4ade80; font-size: .7rem; margin-left: 2px; }
@keyframes subiu { 0%,100% { filter: none; } 30% { filter: brightness(1.8) drop-shadow(0 0 12px #4ade80); } }
.race-row.eu .race-track { outline: 2px dashed rgba(255,255,255,.7); outline-offset: 2px; }
.coroa { animation: coroa 2s ease-in-out infinite; display: inline-block; }
@keyframes coroa { 0%,100% { transform: rotate(-8deg) translateY(0); } 50% { transform: rotate(8deg) translateY(-3px); } }

/* ---------- Player ---------- */
.player-fixo { position: fixed; left: 0; right: 0; bottom: calc(62px + env(safe-area-inset-bottom)); z-index: 45; }
@media (min-width: 768px) { .player-fixo { position: sticky; top: 5rem; bottom: auto; } }
.barra-audio { position: relative; height: 14px; border-radius: 9999px; background: rgba(255,255,255,.12); cursor: pointer; touch-action: none; }
.barra-audio .liberado { position: absolute; inset: 0 auto 0 0; background: rgba(255,255,255,.18); border-radius: 9999px; }
.barra-audio .atual { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg,#8b5cf6,#ec4899); border-radius: 9999px; }
.barra-audio .knob { position: absolute; top: 50%; width: 22px; height: 22px; margin-left: -11px; margin-top: -11px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 5px rgba(236,72,153,.35); }
.btn-redondo { width: 56px; height: 56px; border-radius: 9999px; display: inline-flex; align-items: center; justify-content: center; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); font-weight: 700; font-size: .8rem; transition: .15s; }
.btn-redondo:active { transform: scale(.92); }
.btn-play { width: 76px; height: 76px; font-size: 1.9rem; background: linear-gradient(135deg,#8b5cf6,#ec4899); border: 0; box-shadow: 0 10px 30px -6px rgba(236,72,153,.8); }
.vel-btn { padding: .45rem .8rem; border-radius: .7rem; font-weight: 700; font-size: .85rem; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15); min-height: 40px; }
.vel-btn.ativo { background: #fff; color: #6d28d9; }
.equalizer { display: inline-flex; gap: 3px; align-items: flex-end; height: 18px; }
.equalizer i { width: 4px; background: #f0abfc; border-radius: 2px; animation: eq 1s ease-in-out infinite; }
.equalizer i:nth-child(2) { animation-delay: -.3s; } .equalizer i:nth-child(3) { animation-delay: -.6s; } .equalizer i:nth-child(4) { animation-delay: -.15s; }
.equalizer.parado i { animation-play-state: paused; height: 4px !important; }
@keyframes eq { 0%,100% { height: 4px; } 50% { height: 18px; } }

/* ---------- Telão / evento ---------- */
.timer-ring { --p: 100; width: 170px; height: 170px; border-radius: 50%;
    background: conic-gradient(var(--cor, #22c55e) calc(var(--p) * 1%), rgba(255,255,255,.1) 0);
    display: grid; place-items: center; transition: background .3s; }
.timer-ring > div { width: 140px; height: 140px; border-radius: 50%; background: rgba(15,10,31,.92); display: grid; place-items: center; font-size: 3.5rem; font-weight: 900; }
@media (min-width: 1024px) { .timer-ring { width: 230px; height: 230px; } .timer-ring > div { width: 192px; height: 192px; font-size: 5rem; } }
.timer-alerta { animation: tremer .5s linear infinite; }
@keyframes tremer { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-3deg); } 75% { transform: rotate(3deg); } }
.chip-part { transition: all .6s ease; }
.chip-part.eliminado { opacity: .35; filter: grayscale(1); transform: scale(.92); }
.chip-part.eliminado .chip-nome { text-decoration: line-through; }
.chip-part.atual { box-shadow: 0 0 0 3px #f0abfc, 0 0 35px rgba(240,171,252,.6); transform: scale(1.05); }
.chip-part.acertou { box-shadow: 0 0 0 3px #4ade80; }
.chip-part.errou { box-shadow: 0 0 0 3px #f87171; }
.chip-part.classificado, .chip-part.campeao { box-shadow: 0 0 0 3px #facc15, 0 0 30px rgba(250,204,21,.5); }
.flash-ok  { animation: flashOk 1.2s ease; }
.flash-err { animation: flashErr 1.2s ease; }
@keyframes flashOk  { 0% { background: rgba(34,197,94,.55); } 100% { background: transparent; } }
@keyframes flashErr { 0% { background: rgba(239,68,68,.55); } 100% { background: transparent; } }
.telao-pergunta { font-size: clamp(1.4rem, 3.6vw, 3.2rem); line-height: 1.2; font-weight: 800; }

/* ---------- Utilitários ---------- */
.linha-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cadeado { filter: grayscale(1); opacity: .55; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 8px; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
