:root {
    --primary-color: #29b6f6;
    --secondary-color: #ffca28;
    --correct-color: #66bb6a;
    --incorrect-color: #ef5350;
    --background-color: #f0f8ff;
    --text-color: #333;
    --white: #fff;
    --shadow: 0 4px 10px rgba(0,0,0,0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 10px;
}

h1, h2, h3 {
    font-family: 'Arial', sans-serif;
    font-weight: bold;
}

#app-container {
    width: 100%;
    max-width: 1000px;
    background-color: var(--white);
    border-radius: 20px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.screen {
    display: none;
    padding: 20px;
    animation: fadeIn 0.5s ease-in-out;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- Tela Inicial --- */
#home-screen {
    text-align: center;
}

#home-screen h1 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 2.5rem;
}

#global-score-container {
    background-color: #e3f2fd;
    padding: 15px;
    border-radius: 10px;
    margin: 0 auto 30px auto;
    display: inline-block;
    border: 2px solid var(--primary-color);
}

#global-score-container h2 {
    margin-bottom: 10px;
}

#global-score-container div {
    font-size: 1.2rem;
}

#game-selection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px;
}

.game-button {
    background-color: var(--secondary-color);
    border: none;
    border-radius: 15px;
    padding: 10px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-color);
}

.game-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.game-button img {
    width: 80px;
    height: 80px;
    margin-bottom: 10px;
    object-fit: cover;
}

.game-button span {
    font-family: 'Fredoka One', cursive;
    font-size: 1.1rem;
}

/* --- Tela do Jogo --- */
#game-screen header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

#back-button {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 20px;
    padding: 10px 20px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

#back-button:hover {
    background-color: #0288d1;
}

#game-title {
    color: var(--primary-color);
    font-size: 1.8rem;
}

#current-score-container {
    background-color: #e3f2fd;
    padding: 5px 15px;
    border-radius: 10px;
    text-align: right;
}

.score-label {
    font-weight: bold;
}

#words-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    padding: 15px;
    background-color: #f0f0f0;
    border-radius: 10px;
    min-height: 80px;
}

.word-card {
    background-color: var(--secondary-color);
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 1.2rem;
    cursor: grab;
    user-select: none;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow);
}

.word-card.dragging {
    opacity: 0.5;
    transform: scale(1.1);
}

.word-card.touch-dragging {
    position: fixed;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.8;
}

.word-card.correct {
    background-color: var(--correct-color);
    color: var(--white);
    cursor: not-allowed;
}

.word-card.incorrect {
    background-color: var(--incorrect-color);
    color: var(--white);
    cursor: not-allowed;
}

#drop-zones {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.drop-zone {
    background-color: #e0e0e0;
    border: 3px dashed var(--primary-color);
    border-radius: 15px;
    padding: 20px;
    min-height: 200px;
    transition: background-color 0.3s;
}

.drop-zone.over {
    background-color: #c0e6fa;
}

.drop-zone h3 {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.words-landed {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

#completion-message {
    text-align: center;
    padding: 30px;
    background-color: #e8f5e9;
    border-radius: 15px;
    margin-top: 20px;
}
#completion-message h2 {
    color: var(--correct-color);
    font-size: 2rem;
}
#completion-message p {
    font-size: 1.2rem;
    margin: 10px 0 20px 0;
}
#next-game-button, #completion-message button {
    background-color: var(--correct-color);
    color: white;
    padding: 12px 25px;
    border-radius: 20px;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}
#next-game-button:hover, #completion-message button:hover {
    background-color: #388e3c;
}

.hidden {
    display: none !important;
}

/* Responsividade */
@media (max-width: 600px) {
    body {
        padding: 5px;
    }
    .screen {
        padding: 15px;
    }
    #home-screen h1 {
        font-size: 2rem;
    }
    #game-selection {
        gap: 15px;
        grid-template-columns: repeat(2, 1fr);
    }
    .game-button img {
        width: 60px;
        height: 60px;
    }
    #game-screen header {
        flex-direction: column;
        gap: 15px;
    }
    #drop-zones {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .drop-zone {
        padding: 10px;
        min-height: 150px;
    }
    .drop-zone h3 {
        font-size: 1.8rem;
    }
}