:root {
    --primary-color: #4a90e2;
    --secondary-color: #50e3c2;
    --background-color: #f0f8ff;
    --text-color: #333;
    --correct-color: #28a745;
    --incorrect-color: #dc3545;
    --white: #ffffff;
    --light-gray: #f4f4f4;
    --gray: #ccc;
}

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

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

#app-container {
    width: 100%;
    max-width: 800px;
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
    overflow: hidden;
    position: relative;
    text-transform: uppercase;
}

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

.screen.active {
    display: block;
}

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

h1 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.game-instructions {
    text-align: center;
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 400;
    margin-bottom: 1.5rem;
    padding: 0 1rem;
}

.score-display {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    background: var(--primary-color);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    margin: 0 auto 1.5rem auto;
    width: fit-content;
}

#game-selection {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 600px) {
    #game-selection {
        grid-template-columns: repeat(3, 1fr);
    }
}

.game-selector {
    background: var(--white);
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.game-selector:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}

.game-selector img {
    width: 100%;
    max-width: 150px;
    height: auto;
    border-radius: 8px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

header .score-display {
    margin: 0;
}

.home-btn {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s, color 0.2s;
}

.home-btn:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.game-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.game-content img {
    width: 100%;
    max-width: 400px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.sentence-container {
    font-size: 1.2rem;
    line-height: 1.6;
    text-align: center;
    padding: 1rem;
    background-color: var(--light-gray);
    border-radius: 8px;
    min-height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    text-transform: uppercase;
}

#game-1-sentence-container .blank {
    display: inline-block;
    width: 120px;
    height: 40px;
    background: #e0e0e0;
    border: 2px dashed var(--gray);
    border-radius: 8px;
    vertical-align: middle;
}

.options-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    user-select: none;
}

.word-option, .draggable-word, .clickable-word {
    padding: 0.75rem 1.5rem;
    background-color: var(--secondary-color);
    color: var(--white);
    border-radius: 25px;
    cursor: grab;
    font-weight: 600;
    transition: background-color 0.2s;
    text-transform: uppercase;
}

.word-option:hover, .draggable-word:hover, .clickable-word:hover {
    background-color: #48c9b0;
}

.word-option.dragging {
    opacity: 0.5;
}

.word-dropzone {
    border: 2px dashed var(--gray);
    padding: 1rem;
}

.feedback {
    font-size: 1.2rem;
    font-weight: 600;
    min-height: 30px;
}

.feedback.correct {
    color: var(--correct-color);
}

.feedback.incorrect {
    color: var(--incorrect-color);
}

.check-btn, .next-btn {
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
    color: var(--white);
}

.check-btn {
    background-color: var(--primary-color);
}

.check-btn:hover {
    background-color: #3a7ac2;
}

.next-btn {
    background-color: var(--secondary-color);
}

.next-btn:hover {
    background-color: #48c9b0;
}

.hidden {
    display: none;
}

.no-space-sentence {
    letter-spacing: 0.5px;
    word-break: break-all;
    cursor: pointer;
    user-select: none;
}

.no-space-sentence .letter {
    display: inline-block;
}

.no-space-sentence .letter:hover {
    background-color: rgba(80, 227, 194, 0.3);
}

.no-space-sentence .space-marker {
    display: inline-block;
    width: 3px;
    height: 1.2rem;
    background-color: var(--primary-color);
    margin: 0 3px;
    vertical-align: middle;
    animation: blink 1s infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}