/* ===============================
   VARIÁVEIS E CORES CUSTOMIZADAS
================================ */
:root {
    --cor-primaria: #facc15;
    --cor-secundaria: #f59e0b;
    --cor-sucesso: #22c55e;
    --cor-perigo: #ef4444;
    --cor-escuro: #0f172a;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    /* Substitua pelo caminho da sua imagem */
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.7)), 
                url('../assets/images/background-portas.png') no-repeat center center fixed;
    background-size: cover;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
}

h1 {
  /* deixe o h1 normal */
  text-shadow: 0 0 30px rgba(250, 204, 21, 0.3);
  letter-spacing: 1px;
}

.h1-gradiente{
  background: linear-gradient(135deg, #facc15, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}

.h1-emoji{
  -webkit-text-fill-color: initial; /* garante que não fique transparente */
  background: none;
  display: inline-block;
  margin-right: 6px;
}

/* ===============================
   TELA INICIAL
================================ */
#tela-inicial input[type="text"] {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--cor-primaria);
    color: #fff;
    transition: all 0.3s ease;
}

#tela-inicial input[type="text"]:focus {
    background: rgba(250, 204, 21, 0.1);
    box-shadow: 0 0 20px rgba(250, 204, 21, 0.3);
    border-color: var(--cor-secundaria);
    outline: none;
}

#tela-inicial input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

#tela-inicial .btn-warning {
    background: linear-gradient(135deg, #facc15, #f59e0b);
    border: 2px solid var(--cor-primaria);
    color: var(--cor-escuro);
    transition: all 0.3s ease;
}

#tela-inicial .btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(250, 204, 21, 0.3);
}

#tela-inicial .btn-link {
    margin-top: 20px;
}

#opcoes-infinito {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(250, 204, 21, 0.2);
}

#opcoes-infinito label {
    cursor: pointer;
}

/* ===============================
   PORTAS
================================ */
.porta {
    width: 85px;
    height: 130px;
    border-radius: 8px;
    cursor: pointer;
    background-size: cover;
    background-position: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex-shrink: 0;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
    border: 2px solid var(--cor-primaria);
    position: relative;
    overflow: hidden;
    perspective: 800px;
}

.porta:hover:not(.escolhida):not(.segura):not(.monstro) {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 25px rgba(250, 204, 21, 0.3);
}

.porta.escolhida {
    animation: pulse-selected 0.6s ease;
    pointer-events: none;
}

.porta.segura {
    background: linear-gradient(135deg, #22c55e, #16a34a) !important;
    border-color: #22c55e;
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.6);
    animation: glow-safe 0.8s ease infinite;
}

.porta.monstro {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    border-color: #ef4444;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.6);
    animation: glow-danger 0.8s ease infinite;
}

.porta-inner {
    width: 100%;
    height: 100%;
    border-radius: 6px;
    transition: transform 0.6s ease;
    background-color: #1e293b;
    background-size: cover;
    background-position: center;
    transform-style: preserve-3d;     /* ✅ mantém 3D */
    transform-origin: left center;    /* ✅ dobradiça na esquerda (troque para right se preferir) */
    backface-visibility: hidden;      /* ✅ evita “placa” estranha */
    will-change: transform;           /* ✅ suaviza */
}

.porta.segura .porta-inner {
  background: linear-gradient(135deg, #22c55e, #16a34a);
}

.porta.monstro .porta-inner {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

/* ===============================
   MENSAGEM E LOADING
================================ */
.mensagem {
    min-height: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 15px;
}

.mensagem.escolhendo {
    animation: pulse 1s ease-in-out;
}

.perdeu {
    color: #ff6b6b;
    font-weight: 600;
}

.venceu {
    color: #4cff4c;
    font-weight: 600;
}

#loading {
    margin: 20px 0;
}

/* ===============================
   RANKING
================================ */
#tela-ranking .btn-warning {
    background: linear-gradient(135deg, #facc15, #f59e0b);
    border: 2px solid var(--cor-primaria);
    color: var(--cor-escuro);
}

#tela-ranking .btn-warning:hover {
    transform: translateX(-3px);
}

#tela-ranking .btn-outline-warning {
    border: 2px solid var(--cor-primaria);
    color: var(--cor-primaria);
}

#tela-ranking .btn-outline-warning:hover,
#tela-ranking .btn-outline-warning.active {
    background: rgba(250, 204, 21, 0.2);
    border-color: var(--cor-primaria);
    color: var(--cor-primaria);
}

#ranking-lateral {
    font-size: 12px;
}

#ranking-lateral thead {
    background: rgba(250, 204, 21, 0.15);
}

#ranking-lateral th {
    color: var(--cor-primaria);
    font-weight: 600;
    font-size: 11px;
}

#ranking-lateral tbody tr {
    display: none;
}

#ranking-lateral tbody tr:nth-child(1),
#ranking-lateral tbody tr:nth-child(2),
#ranking-lateral tbody tr:nth-child(3),
#ranking-lateral tbody tr:nth-child(4),
#ranking-lateral tbody tr:nth-child(5) {
    display: table-row;
}

#ranking-lateral tbody tr:hover {
    background: rgba(250, 204, 21, 0.05) !important;
}

/* ===============================
   TELA DE VITÓRIA
================================ */
#vitoria {
    background: radial-gradient(circle at center, rgba(15, 23, 42, 0.95), rgba(2, 6, 23, 0.98));
}

#vitoria .btn-success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border: 2px solid #22c55e;
    transition: all 0.3s ease;
}

#vitoria .btn-success:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(34, 197, 94, 0.6);
}

/* ===============================
   ANIMAÇÕES
================================ */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes pulse-selected {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.08);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes glow-safe {
    0%, 100% {
        box-shadow: 0 0 15px rgba(34, 197, 94, 0.5);
    }
    50% {
        box-shadow: 0 0 25px rgba(34, 197, 94, 0.8);
    }
}

@keyframes glow-danger {
    0%, 100% {
        box-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
    }
    50% {
        box-shadow: 0 0 25px rgba(239, 68, 68, 0.8);
    }
}

/* ===============================
   RESPONSIVIDADE
================================ */
@media (min-width: 768px) {
    .porta {
        width: 110px;
        height: 165px;
        border-width: 3px;
    }

    #tela-inicial,
    #tela-ranking,
    #vitoria {
        padding: 40px 20px;
    }

    #tela-ranking .w-100 {
        max-width: 600px !important;
    }
}

@media (min-width: 992px) {
    .porta {
        width: 130px;
        height: 195px;
    }
}

/* ===============================
   ITENS (CHAVE / PORÇÃO)
================================ */
.itens-bar {
    gap: 12px;
    margin-bottom: 6px;
}
.itens-bar .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.porta.bloqueada {
    filter: grayscale(60%);
    opacity: 0.85;
    pointer-events: none;
    position: relative;
}
.porta.bloqueada::after {
    content: '\1F512'; /* 🔒 */
    position: absolute;
    right: 8px;
    top: 8px;
    font-size: 18px;
}

.vitoria-container{
  position: relative;
  display: inline-block;
  max-width: 320px;
}

.vitoria-container img{
  width: 100%;
  border-radius: 12px;
}

.vitoria-texto{
  position: absolute;
  inset: 0;

  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;

  padding: 16px;

  font-size: 18px;
  font-weight: 800;
  color: #fff;

  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(3px);

  border-radius: 12px;

  animation: fadeInVictory 0.7s ease;
}

@keyframes fadeInVictory {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}
