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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.hidden {
    display: none !important;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 20px;
}

.header {
    text-align: center;
    color: white;
    margin-bottom: 20px;
    position: relative;
}

.player-info {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 10px 20px;
    font-size: 1.1em;
}

.player-name {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    font-weight: bold;
}

.audio-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 10px;
    z-index: 100;
}

.audio-btn {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.audio-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.audio-btn:active {
    transform: scale(0.95);
}

.audio-btn.muted {
    opacity: 0.5;
    background: rgba(255, 255, 255, 0.1);
}

.audio-btn.muted .audio-icon {
    filter: grayscale(100%);
}

.audio-icon {
    display: inline-block;
    transition: transform 0.2s ease;
}

.score {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.4) 0%, rgba(255, 193, 7, 0.4) 100%);
    padding: 8px 16px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
    border: 2px solid rgba(255, 215, 0, 0.5);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 5px;
}

.score-icon {
    font-size: 1.2em;
    animation: sparkle 1.5s ease-in-out infinite;
}

.score-value {
    font-size: 1.1em;
}

.header h1 {
    font-size: 3em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 10px;
}

.info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.progress-bar-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.progress-bar {
    width: 200px;
    height: 12px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50 0%, #81c784 50%, #a5d6a7 100%);
    border-radius: 10px;
    width: 0%;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.6);
    animation: progress-glow 2s ease-in-out infinite;
}

.progress-text {
    color: white;
    font-size: 0.9em;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

@keyframes progress-glow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(76, 175, 80, 0.6);
    }
    50% {
        box-shadow: 0 0 20px rgba(76, 175, 80, 0.9);
    }
}

@keyframes sparkle {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: scale(1.2) rotate(180deg);
        opacity: 0.8;
    }
}

.info p {
    font-size: 1.2em;
}

.mode-indicator {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

#mode-text {
    font-size: 1.3em;
    font-weight: bold;
    color: white;
}

.game-area {
    flex: 1;
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: inset 0 0 50px rgba(255, 255, 255, 0.1);
}

.celebration-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

.feedback-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4em;
    font-weight: bold;
    color: white;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.8), 0 0 40px rgba(76, 175, 80, 0.8);
    z-index: 101;
    pointer-events: none;
    animation: feedback-pop 0.8s ease-out;
}

@keyframes feedback-pop {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
}

.particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #ffd700;
    border-radius: 50%;
    pointer-events: none;
    z-index: 99;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

.star-particle {
    font-size: 1.5em;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

.falling-element {
    position: absolute;
    font-size: 4em;
    font-weight: bold;
    color: white;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
    user-select: none;
    z-index: 1;
}

.falling-element.letter {
    color: #ffeb3b;
    text-shadow: 0 0 10px rgba(255, 235, 59, 0.8);
}

.falling-element.syllable {
    color: #4caf50;
    text-shadow: 0 0 10px rgba(76, 175, 80, 0.8);
}

.falling-element.word {
    color: #ff9800;
    text-shadow: 0 0 10px rgba(255, 152, 0, 0.8);
    font-size: 3em;
}

/* Estado: esperando input do usuário */
.falling-element.waiting-input {
    animation: appear 0.5s ease-out, fall var(--fall-duration, 5s) linear, pulse 1s ease-in-out infinite;
    border: 3px solid rgba(255, 255, 255, 0.6);
    border-radius: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
}

/* Estado: resposta correta */
.falling-element.correct {
    animation: appear 0.5s ease-out, fall var(--fall-duration, 5s) linear, correct-celebration 0.6s ease-out;
    border: 4px solid #4caf50;
    border-radius: 10px;
    padding: 10px;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.4) 0%, rgba(129, 199, 132, 0.4) 100%);
    box-shadow: 0 0 30px rgba(76, 175, 80, 1), 0 0 60px rgba(76, 175, 80, 0.6);
    transform: scale(1.2);
}

@keyframes correct-celebration {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3) rotate(5deg);
    }
    100% {
        transform: scale(1.2);
    }
}

/* Estado: resposta errada (feedback visual temporário) */
.falling-element.wrong {
    border: 4px solid #f44336;
    background: rgba(244, 67, 54, 0.3);
    animation: shake 0.3s ease-in-out;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

@keyframes fall {
    from {
        top: -100px;
        opacity: 1;
    }
    to {
        top: 100vh;
        opacity: 0.3;
    }
}

.footer {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.btn {
    padding: 15px 30px;
    font-size: 1.1em;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    font-weight: bold;
}

.btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.btn:active {
    transform: scale(0.95);
}

/* Efeito de destaque quando aparece */
@keyframes appear {
    0% {
        transform: scale(0) rotate(0deg);
    }
    50% {
        transform: scale(1.2) rotate(180deg);
    }
    100% {
        transform: scale(1) rotate(360deg);
    }
}

/* Tela de Início */
.start-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    animation: fadeIn 0.5s ease-in;
}

.start-content {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border-radius: 30px;
    padding: 40px;
    max-width: 600px;
    width: 100%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.6s ease-out;
}

.game-title {
    font-size: 4em;
    text-align: center;
    color: white;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.4);
    margin-bottom: 10px;
    animation: bounce 1s ease-in-out infinite;
}

.game-subtitle {
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2em;
    margin-bottom: 30px;
}

.start-form {
    margin-bottom: 30px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    color: white;
    font-size: 1.2em;
    margin-bottom: 10px;
    font-weight: bold;
}

.input-group input {
    width: 100%;
    padding: 15px 20px;
    font-size: 1.2em;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.input-group input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.input-group input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.btn-start {
    width: 100%;
    padding: 18px;
    font-size: 1.3em;
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    border: none;
    color: white;
    border-radius: 15px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.btn-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.6);
}

.btn-start:active {
    transform: translateY(0);
}

.instructions {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.instructions h3 {
    color: white;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.instructions ul {
    list-style: none;
    padding: 0;
}

.instructions li {
    color: rgba(255, 255, 255, 0.9);
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
    font-size: 1.1em;
}

.instructions li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #4caf50;
    font-weight: bold;
    font-size: 1.2em;
}

/* Modal de Pausa */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-in;
}

.modal-content {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border-radius: 30px;
    padding: 40px;
    max-width: 400px;
    width: 90%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: slideUp 0.4s ease-out;
}

.modal-content h2 {
    color: white;
    font-size: 2em;
    margin-bottom: 20px;
}

.modal-content p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2em;
    margin-bottom: 30px;
    line-height: 1.6;
}

.modal-content .btn {
    margin: 10px;
    min-width: 150px;
}

.btn-pause {
    background: rgba(255, 152, 0, 0.3);
    border-color: rgba(255, 152, 0, 0.5);
}

.btn-pause:hover {
    background: rgba(255, 152, 0, 0.5);
}

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Teclado Virtual para Mobile */
.virtual-keyboard {
    margin-top: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: none;
    flex-direction: column;
    gap: 8px;
}

@media screen and (max-width: 768px) {
    .virtual-keyboard:not(.hidden) {
        display: flex;
    }
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.keyboard-key {
    min-width: 40px;
    height: 45px;
    font-size: 1.2em;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.25);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.15s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.keyboard-key:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.keyboard-key:focus {
    outline: none;
}

/* Responsividade Mobile */
@media screen and (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 1.8em;
        margin-top: 60px;
    }
    
    .player-info {
        font-size: 0.9em;
        padding: 8px 10px;
    }
    
    .player-name, .score {
        padding: 6px 12px;
        font-size: 0.9em;
    }
    
    .audio-controls {
        top: 5px;
        right: 5px;
        gap: 8px;
    }
    
    .audio-btn {
        width: 38px;
        height: 38px;
        font-size: 1.2em;
    }
    
    .mode-indicator {
        padding: 8px 15px;
    }
    
    #mode-text {
        font-size: 1em;
    }
    
    .game-area {
        margin-bottom: 10px;
    }
    
    .falling-element {
        font-size: 3em;
    }
    
    .falling-element.word {
        font-size: 2.2em;
    }
    
    .footer {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 1em;
        flex: 1;
        min-width: calc(33.33% - 7px);
    }
    
    .start-content {
        padding: 25px;
    }
    
    .game-title {
        font-size: 2.5em;
    }
    
    .game-subtitle {
        font-size: 1em;
    }
    
    .instructions {
        padding: 15px;
    }
    
    .instructions h3 {
        font-size: 1.1em;
    }
    
    .instructions li {
        font-size: 0.95em;
    }
    
    .virtual-keyboard {
        margin-top: 10px;
        padding: 10px;
    }
    
    .keyboard-key {
        min-width: 35px;
        height: 40px;
        font-size: 1em;
        flex: 1;
        max-width: 60px;
    }
}

@media screen and (max-width: 480px) {
    .header h1 {
        font-size: 1.5em;
    }
    
    .game-title {
        font-size: 2em;
    }
    
    .falling-element {
        font-size: 2.5em;
    }
    
    .falling-element.word {
        font-size: 1.8em;
    }
    
    .btn {
        padding: 10px 15px;
        font-size: 0.9em;
        min-width: calc(50% - 5px);
    }
    
    .keyboard-key {
        min-width: 30px;
        height: 38px;
        font-size: 0.9em;
        max-width: 50px;
    }
    
    .virtual-keyboard {
        padding: 8px;
        gap: 5px;
    }
    
    .keyboard-row {
        gap: 4px;
    }
    
    .audio-btn {
        width: 35px;
        height: 35px;
        font-size: 1.1em;
    }
}

