:root {
    --primary-color: #4CAF50;
    --secondary-color: #2196F3;
    --accent-color: #FF9800;
    --background-color: #f5f5f5;
    --card-back: #3498db;
    --text-color: #333;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    margin: 0;
    padding: 0;
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: background-color 0.5s;
}

.container {
    width: 100%;
    max-width: 800px;
    padding: 20px;
    box-sizing: border-box;
}

h1 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.game-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.stat {
    text-align: center;
    padding: 5px 15px;
    border-radius: 5px;
    background-color: var(--primary-color);
    color: white;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
    perspective: 1000px;
}

.card {
    aspect-ratio: 1/1;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.5s;
    cursor: pointer;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.card-front {
    background-color: white;
    transform: rotateY(180deg);
}

.card-back {
    background-color: var(--card-back);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.card.flipped {
    transform: rotateY(180deg);
}

.card.matched .card-front {
    background-color: rgba(76, 175, 80, 0.2);
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.1s;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-accent {
    background-color: var(--accent-color);
    color: white;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 5px;
}

.dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}

.dropdown-content a:hover {
    background-color: #f1f1f1;
    border-radius: 5px;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: black;
}

.name-input {
    padding: 8px;
    margin: 10px 0;
    width: 80%;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th, td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: var(--primary-color);
    color: white;
}

tr:nth-child(even) {
    background-color: #f2f2f2;
}

tr:hover {
    background-color: #ddd;
}

.instructions-list {
    text-align: left;
    padding-left: 20px;
}

/* Estilos para temas */
body.theme-animals {
    --primary-color: #4CAF50;
    --secondary-color: #2196F3;
    --accent-color: #FF9800;
    --background-color: #EBFAEB;
    --card-back: #3E8E41;
}

body.theme-sports {
    --primary-color: #F44336;
    --secondary-color: #2196F3;
    --accent-color: #FFC107;
    --background-color: #E3F2FD;
    --card-back: #1565C0;
}

body.theme-emojis {
    --primary-color: #9C27B0;
    --secondary-color: #E91E63;
    --accent-color: #FFEB3B;
    --background-color: #FCE4EC;
    --card-back: #C2185B;
}

/* Responsividade */
@media (max-width: 600px) {
    .game-board {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .game-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .stat {
        width: 100%;
    }
}

@media (max-width: 400px) {
    .game-board {
        grid-template-columns: repeat(2, 1fr);
    }
}