:root {
    --roxo: #7c3aed;
    --roxo-escuro: #5b21b6;
    --rosa: #ec4899;
    --verde: #22c55e;
    --amarelo: #f59e0b;
    --vermelho: #ef4444;
    --fundo: #120b1f;
    --fundo-cartao: #1e1330;
    --texto: #f5f3ff;
    --texto-suave: #c4b5fd;
    --borda: #3b2a5c;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Segoe UI', Roboto, Arial, sans-serif;
    background: linear-gradient(160deg, var(--fundo) 0%, #1a0f2e 100%);
    color: var(--texto);
    min-height: 100vh;
}

a { color: var(--texto-suave); }

/* ---------- Login ---------- */
.tela-centralizada {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.cartao-login {
    background: var(--fundo-cartao);
    border: 1px solid var(--borda);
    border-radius: 16px;
    padding: 36px 32px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}

.cartao-login h1 { margin: 0 0 4px; font-size: 26px; }
.subtitulo { color: var(--texto-suave); margin-bottom: 24px; }

.cartao-login form { text-align: left; display: flex; flex-direction: column; gap: 6px; }
.cartao-login label { font-size: 13px; color: var(--texto-suave); margin-top: 10px; }

input, select, textarea {
    background: #150c26;
    border: 1px solid var(--borda);
    color: var(--texto);
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 15px;
    width: 100%;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--roxo);
}

.botao {
    border: none;
    border-radius: 10px;
    padding: 13px 20px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.08s ease, opacity 0.15s ease;
}
.botao:active { transform: scale(0.97); }
.botao:disabled { opacity: 0.45; cursor: not-allowed; }

.botao-primario {
    background: linear-gradient(135deg, var(--roxo), var(--rosa));
    color: white;
    margin-top: 18px;
}

.alerta { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; }
.alerta-erro { background: rgba(239,68,68,0.15); color: #fca5a5; border: 1px solid rgba(239,68,68,0.4); }
.alerta-sucesso { background: rgba(34,197,94,0.15); color: #86efac; border: 1px solid rgba(34,197,94,0.4); }

.dica { font-size: 12px; color: var(--texto-suave); margin-top: 20px; line-height: 1.6; }
.dica code { background: #150c26; padding: 2px 6px; border-radius: 4px; }

/* ---------- Jogo ---------- */
.pagina-jogo { display: flex; flex-direction: column; min-height: 100vh; }

.topo-jogo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: rgba(30, 19, 48, 0.7);
    border-bottom: 1px solid var(--borda);
}
.topo-direita { display: flex; gap: 14px; align-items: center; }
.topo-direita a { text-decoration: none; font-size: 20px; }
.moedas { font-weight: 700; font-size: 16px; }

.area-jogo {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 16px 100px;
}

.faixa-vez {
    width: 100%;
    max-width: 420px;
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 16px;
    border: 1px solid var(--borda);
    text-align: center;
}
.faixa-vez.vez-ele {
    background: linear-gradient(135deg, #1e3a5f 0%, #241638 100%);
    border-color: #3b82f6;
}
.faixa-vez.vez-ela {
    background: linear-gradient(135deg, #5b2154 0%, #241638 100%);
    border-color: var(--rosa);
}
.faixa-vez-titulo { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.faixa-vez-sub { font-size: 12px; color: var(--texto-suave); line-height: 1.4; }

.instrucao-vez {
    width: 100%;
    background: #241638;
    border: 1px dashed var(--borda);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 14px;
    color: var(--texto-suave);
    line-height: 1.45;
    text-align: left;
}
.instrucao-vez strong { color: var(--texto); }

.badge-quem {
    display: inline-block;
    background: var(--roxo);
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    padding: 8px 18px;
    border-radius: 999px;
    margin-bottom: 6px;
}

.timer-dica { margin: 6px 0 0; font-size: 12px; color: var(--texto-suave); text-align: center; }

.botao-secundario {
    background: #241638;
    color: var(--texto-suave);
    border: 1px solid var(--borda);
    font-size: 13px;
    padding: 13px 12px;
}

.seletor-nivel {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--texto-suave);
}
.seletor-nivel select { width: auto; padding: 8px 12px; }

.palco-carta { width: 100%; max-width: 420px; display: flex; flex-direction: column; align-items: center; gap: 18px; }

.carta {
    background: linear-gradient(160deg, var(--fundo-cartao), #2a1a45);
    border: 1px solid var(--borda);
    border-radius: 20px;
    padding: 40px 28px;
    width: 100%;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 20px;
    line-height: 1.5;
    box-shadow: 0 12px 30px rgba(0,0,0,0.35);
}

.carta-placeholder { color: var(--texto-suave); font-size: 16px; }

.carta.tipo-pergunta { border-color: var(--roxo); }
.carta.tipo-desafio { border-color: var(--rosa); }
.carta.tipo-termometro { border-color: var(--amarelo); }

.etiqueta-tipo {
    display: inline-block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 14px;
}

.area-timer { display: flex; justify-content: center; }
.timer-circulo {
    width: 90px; height: 90px;
    border-radius: 50%;
    border: 4px solid var(--rosa);
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; font-weight: 700;
}
.timer-circulo.alerta-tempo { border-color: var(--vermelho); animation: pulsar 1s infinite; }
@keyframes pulsar { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }

.area-termometro, .area-resposta { width: 100%; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.area-termometro p, .pergunta-quem { color: var(--texto-suave); font-size: 14px; margin: 0; }

.botoes-termometro, .botoes-quem, .botoes-resultado { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

.botao-termometro, .botao-quem {
    background: #241638; color: var(--texto); border: 1px solid var(--borda);
}
.botao-quem.selecionado { background: var(--roxo); border-color: var(--roxo); }

.botao-feito { background: var(--verde); color: #052e12; }
.botao-pulou { background: #3a2650; color: var(--texto); }
.botao-depois { background: var(--amarelo); color: #452b02; }

.acoes-carta { display: flex; gap: 10px; width: 100%; }
.acoes-carta .botao-primario { flex: 1; }
.botao-fav { background: #241638; color: var(--amarelo); border: 1px solid var(--borda); }
.botao-fav.ativa { background: var(--amarelo); color: #452b02; }

.mensagem-evento {
    margin-top: 20px;
    padding: 14px 18px;
    border-radius: 12px;
    background: rgba(124,58,237,0.18);
    border: 1px solid var(--roxo);
    text-align: center;
    max-width: 420px;
    width: 100%;
}

.oculto { display: none !important; }

/* Botão safeword sempre visível */
.botao-safeword {
    position: fixed;
    bottom: 18px;
    right: 18px;
    background: var(--vermelho);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 14px 20px;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 6px 20px rgba(239,68,68,0.5);
    cursor: pointer;
    z-index: 50;
}

.overlay {
    position: fixed; inset: 0;
    background: rgba(10, 5, 20, 0.92);
    display: flex; align-items: center; justify-content: center;
    z-index: 100;
    padding: 20px;
}
.cartao-overlay {
    background: var(--fundo-cartao);
    border: 1px solid var(--borda);
    border-radius: 16px;
    padding: 32px;
    max-width: 380px;
    text-align: center;
}
.cartao-overlay h2 { margin-top: 0; }
.cartao-overlay button { margin-top: 18px; width: 100%; }

/* ---------- Admin ---------- */
.admin-wrapper { display: flex; min-height: 100vh; }
.admin-menu {
    width: 220px;
    background: var(--fundo-cartao);
    border-right: 1px solid var(--borda);
    padding: 20px 0;
    flex-shrink: 0;
}
.admin-menu h2 { padding: 0 20px; font-size: 16px; margin-bottom: 20px; }
.admin-menu a {
    display: block;
    padding: 12px 20px;
    text-decoration: none;
    color: var(--texto-suave);
    font-size: 14px;
    border-left: 3px solid transparent;
}
.admin-menu a:hover, .admin-menu a.ativo { background: rgba(124,58,237,0.15); color: var(--texto); border-left-color: var(--roxo); }

.admin-conteudo { flex: 1; padding: 30px; max-width: 1100px; }
.admin-conteudo h1 { margin-top: 0; }

.tabela-admin { width: 100%; border-collapse: collapse; margin-top: 20px; font-size: 14px; }
.tabela-admin th, .tabela-admin td { padding: 10px 12px; border-bottom: 1px solid var(--borda); text-align: left; }
.tabela-admin th { color: var(--texto-suave); font-weight: 600; font-size: 12px; text-transform: uppercase; }
.tabela-admin tr:hover { background: rgba(124,58,237,0.06); }

.tag { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.tag-pergunta { background: rgba(124,58,237,0.25); color: #d8b4fe; }
.tag-desafio { background: rgba(236,72,153,0.25); color: #f9a8d4; }
.tag-termometro { background: rgba(245,158,11,0.25); color: #fde68a; }

.form-admin { display: flex; flex-direction: column; gap: 4px; max-width: 640px; margin-top: 20px; }
.form-admin label { font-size: 13px; color: var(--texto-suave); margin-top: 12px; }
.form-admin .linha { display: flex; gap: 16px; }
.form-admin .linha > div { flex: 1; }
.form-admin button { margin-top: 20px; align-self: flex-start; }

.cartoes-dashboard { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 20px; }
.cartao-metrica {
    background: var(--fundo-cartao);
    border: 1px solid var(--borda);
    border-radius: 12px;
    padding: 18px 22px;
    min-width: 150px;
}
.cartao-metrica .numero { font-size: 28px; font-weight: 700; }
.cartao-metrica .rotulo { font-size: 12px; color: var(--texto-suave); }

.acoes-linha { display: flex; gap: 8px; }
.acoes-linha a, .acoes-linha button { font-size: 12px; padding: 6px 10px; }

.botao-link { background: none; border: none; color: var(--texto-suave); text-decoration: underline; cursor: pointer; font-size: 13px; padding: 0; }
.botao-perigo { background: var(--vermelho); color: white; }
.botao-secundario { background: #241638; color: var(--texto); border: 1px solid var(--borda); }

.barra-progresso { background: #150c26; border-radius: 20px; height: 8px; width: 120px; overflow: hidden; }
.barra-progresso-preenchida { background: var(--roxo); height: 100%; }

.badge-status { font-size: 11px; padding: 3px 9px; border-radius: 20px; }
.badge-bloqueada { background: rgba(148,163,184,0.2); color: #cbd5e1; }
.badge-nao_iniciada { background: rgba(59,130,246,0.2); color: #93c5fd; }
.badge-em_andamento { background: rgba(245,158,11,0.2); color: #fde68a; }
.badge-em_espera { background: rgba(239,68,68,0.2); color: #fca5a5; }
.badge-concluida { background: rgba(34,197,94,0.2); color: #86efac; }

@media (max-width: 760px) {
    .admin-wrapper { flex-direction: column; }
    .admin-menu { width: 100%; display: flex; overflow-x: auto; padding: 10px 0; }
    .admin-menu h2 { display: none; }
    .admin-menu a { border-left: none; border-bottom: 3px solid transparent; white-space: nowrap; }
    .admin-menu a.ativo { border-bottom-color: var(--roxo); }
    .admin-conteudo { padding: 18px; }
    .form-admin .linha { flex-direction: column; gap: 0; }
}
