/* Importar fontes modernas */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

/* Estilos gerais */
:root {
    --primary-color: #0F65B0;
    --primary-dark: #0d5494;
    --secondary-color: #1e88e5;
    --success-color: #48bb78;
    --danger-color: #f56565;
    --warning-color: #ed8936;
    --background-gradient: linear-gradient(135deg, #0F65B0 0%, #1e88e5 100%);
    --card-gradient: linear-gradient(145deg, #ffffff 0%, #f7fafc 100%);
    --shadow-soft: 0 10px 40px rgba(15, 101, 176, 0.1);
    --shadow-strong: 0 20px 60px rgba(15, 101, 176, 0.3);
    --font-family: 'Poppins', sans-serif;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: var(--background-gradient);
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Efeito de partículas animadas no fundo */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

/* Header com efeito glassmorphism */
.main-header {
    background: #fff;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: var(--shadow-soft);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all 0.3s ease;
}

.logo-header {
    max-height: 50px;
    max-width: 80%;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s ease;
}

.logo-header:hover {
    transform: scale(1.05);
}

/* Conteúdo principal */
.tela-jogo {
    width: 100%;
    padding-left: 150px;
    padding-right: 150px;
    flex: 1;
    display: flex;
    align-items: center;
}

.hero-content .row {
    background: var(--card-gradient);
    border-radius: 20px;
    box-shadow: var(--shadow-strong);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.hero-image:hover {
    transform: scale(1.02);
}

.content-box {
    position: relative;
}

.content-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(15, 101, 176, 0.1) 0%, transparent 70%);
    animation: pulse-bg 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes pulse-bg {

    0%,
    100% {
        opacity: 0.3;
        transform: scale(1);
    }

    50% {
        opacity: 0.1;
        transform: scale(1.1);
    }
}

/* Cards modernos */
.card {
    border-radius: 20px;
    overflow: hidden;
    border: none;
    background: var(--card-gradient);
    box-shadow: var(--shadow-strong);
    padding: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 80px rgba(15, 101, 176, 0.4);
}

/* Botões com efeitos modernos */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    border-radius: 50px;
    padding: 15px 40px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 8px 30px rgba(15, 101, 176, 0.3);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(15, 101, 176, 0.5);
}

.btn-secondary {
    background: linear-gradient(135deg, #718096 0%, #4a5568 100%);
    border: none;
    border-radius: 50px;
    padding: 15px 40px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 8px 30px rgba(113, 128, 150, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(113, 128, 150, 0.5);
}

.btn-action {
    min-width: 140px;
    padding: 12px 30px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 50px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-action:hover {
    transform: translateY(-2px) scale(1.05);
}

/* Estilização do tabuleiro do jogo */
.memoria-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    max-width: 1000px;
    margin: 0 auto;
    padding: 15px;
    align-items: start;
}

/* Cards do jogo sem efeitos 3D */
.card-memoria {
    position: relative;
    width: 100%;
    cursor: pointer;
    aspect-ratio: 4/5;
    border-radius: 20px;
    overflow: hidden;
}

.face {
    position: absolute;
    width: 100%;
    /* height: 100%; */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    transition: opacity 0.3s ease;
}

.frente {
    background: linear-gradient(145deg, #4299e1 0%, #3182ce 100%);
    border: 3px solid var(--primary-color);
    opacity: 0;
    z-index: 1;
}

.verso {
    background: linear-gradient(145deg, #0F65B0 0%, #0d5494 100%);
    border: 3px solid var(--primary-color);
    opacity: 1;
    z-index: 2;
    height: 100%;
}

.verso::after {
    content: '?';
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: bold;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.card-memoria.virada .frente {
    opacity: 1;
    z-index: 2;
}

.card-memoria.virada .verso {
    opacity: 0;
    z-index: 1;
}

.card-memoria.encontrado .frente {
    border: 4px solid var(--success-color);
    background: linear-gradient(145deg, #48bb78 0%, #38a169 100%);
}

.card-memoria img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    border-radius: 20px;
}

/* Badges com efeitos modernos */
.badge {
    font-size: 1.1rem;
    padding: 12px 20px;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.badge.fs-6 {
    font-size: 1.2rem !important;
}

.badge:hover {
    transform: scale(1.05);
}

/* Timer com animações dinâmicas */
#timer {
    min-width: 120px;
    text-align: center;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%) !important;
}

#timer.bg-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #dd6b20 100%) !important;
    color: white !important;
    animation: pulse-warning 1s infinite;
}

#timer.bg-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #e53e3e 100%) !important;
    color: white !important;
    animation: pulse-danger 0.5s infinite;
}

/* Animações aprimoradas para o timer */
@keyframes pulse-warning {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(237, 137, 54, 0.7);
    }

    50% {
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(237, 137, 54, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(237, 137, 54, 0);
    }
}

@keyframes pulse-danger {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(245, 101, 101, 0.7);
    }

    50% {
        transform: scale(1.15);
        box-shadow: 0 0 0 15px rgba(245, 101, 101, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(245, 101, 101, 0);
    }
}

/* Alertas modernos */
.alert {
    border-radius: 15px;
    border: none;
    padding: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.alert-success {
    background: linear-gradient(135deg, rgba(72, 187, 120, 0.9) 0%, rgba(56, 161, 105, 0.9) 100%);
    color: white;
}

.alert-warning {
    background: linear-gradient(135deg, rgba(237, 137, 54, 0.9) 0%, rgba(221, 107, 32, 0.9) 100%);
    color: white;
}

.alert-info {
    background: linear-gradient(135deg, rgba(66, 153, 225, 0.9) 0%, rgba(49, 130, 206, 0.9) 100%);
    color: white;
}

/* Loading overlay moderno */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 101, 176, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner-border {
    width: 4rem;
    height: 4rem;
    border-width: 4px;
    border-color: white;
    border-right-color: transparent;
}

/* Efeitos de entrada */
.tela-jogo:not(.d-none) {
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsividade aprimorada */
@media (max-width: 768px) {
    .memoria-board {
        grid-template-columns: repeat(3, 1fr);
        gap: 4px;
        padding: 10px;
    }

    .face {
        border-radius: 15px;
    }
}

@media (max-width: 576px) {
    .logo-header {
        max-height: 40px;
    }

    .card {
        padding: 20px;
        border-radius: 15px;
    }

    .btn-action {
        min-width: 120px;
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .badge {
        font-size: 0.9rem;
        padding: 8px 15px;
    }

    .memoria-board {
        grid-template-columns: repeat(2, 1fr);
        gap: 3px;
        padding: 8px;
    }

    .verso::after {
        font-size: 2.5rem;
    }
}

/* Efeitos de hover para elementos interativos */
.form-control {
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    padding: 12px 16px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(15, 101, 176, 0.1);
    background: white;
}

/* Títulos com gradiente */
h1,
h2 {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

/* Efeito de partículas para celebração */
.confetti-container {
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
}

.confetti-container::before,
.confetti-container::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--primary-color);
    animation: confetti 3s linear infinite;
}

.confetti-container::before {
    left: 20%;
    animation-delay: 0s;
}

.confetti-container::after {
    left: 80%;
    animation-delay: 1s;
    background: var(--success-color);
}

@keyframes confetti {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Estilo adicional para o período de preview */
#timer.bg-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%) !important;
    color: white !important;
    animation: pulse-info 1s infinite;
    font-weight: bold;
}

@keyframes pulse-info {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(23, 162, 184, 0.7);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(23, 162, 184, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(23, 162, 184, 0);
    }
}

/* Efeito visual para indicar que está no modo preview */
.card-memoria.virada .frente {
    /* border: 3px solid #17a2b8;
    background: linear-gradient(145deg, #17a2b8 0%, #138496 100%); */
}

/* Mensagem de instrução durante o preview */
.preview-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(23, 162, 184, 0.9);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    z-index: 1000;
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    40% {
        transform: translateX(-50%) translateY(-10px);
    }

    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}