.game-container {
    height: 600px;
    width: 700px;
    background: white;
    margin: 10px auto 50px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.game-header {
    background: linear-gradient(90deg, #4c5baf, #4a66c3);
    color: white;
    padding: 20px;
    text-align: center;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.game-header h2 {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
    flex: 1;
    text-align: center;
}

.header-controls {
    display: flex;
    gap: 15px;
}

.control-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.control-btn.active {
    background: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.control-btn img {
    width: 24px;
    height: 24px;
    transition: all 0.3s ease;
}

.control-btn.active img {
    transform: scale(1.1);
}

.btn-tooltip {
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
}

.control-btn:hover .btn-tooltip {
    opacity: 1;
    visibility: visible;
    bottom: -30px;
}

.game-content {
    padding: 30px;
    text-align: center;
    position: relative;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.target-display {
    font-size: 24px;
    margin-bottom: 30px;
    color: #333;
    position: relative;
    flex-shrink: 0;
}

.target-color {
    font-weight: bold;
    text-transform: uppercase;
    padding: 5px 10px;
    border-radius: 5px;
    background: #f0f0f0;
    display: inline-block;
}

.colors-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 30px;
    flex: 1;
}

.color-btn {
    height: 100px;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.color-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}

.color-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.3);
    opacity: 0;
    transition: opacity 0.3s;
}

.color-btn:hover::after {
    opacity: 1;
}

.game-footer {
    background: #f9f9f9;
    padding: 20px;
    border-top: 1px solid #eee;
    flex-shrink: 0;
}

.btn-voltar {
    background: linear-gradient(135deg, #4c56af, #4a60c3);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(76, 86, 175, 0.3);
    display: inline-block;
    text-decoration: none;
}

.btn-voltar:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(76, 78, 175, 0.4);
}

/* Cores dos botões */
.red { background-color: #FF5252; }
.blue { background-color: #4285F4; }
.green { background-color: #4CAF50; }
.yellow { background-color: #FFD600; }
.purple { background-color: #9C27B0; }
.orange { background-color: #FF9800; }
.pink { background-color: #E91E63; }
.teal { background-color: #009688; }
.cyan { background-color: #00BCD4; }
.lime { background-color: #CDDC39; }
.brown { background-color: #795548; }
.gray { background-color: #9E9E9E; }

.message {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2000;
}

.message.active {
    opacity: 1;
    visibility: visible;
}

.message-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    transform: scale(0.9);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    margin: 20px;
}

.message.active .message-content {
    transform: scale(1);
}

.message.win .message-content {
    background: linear-gradient(135deg, #f6f9fc, #e3f2fd);
    border: 3px solid #4CAF50;
    box-shadow: 0 15px 40px rgba(76, 175, 80, 0.4);
}

.message.error .message-content {
    background: linear-gradient(135deg, #fef7f7, #ffebee);
    border: 3px solid #FF5252;
    box-shadow: 0 15px 40px rgba(255, 82, 82, 0.4);
}

.message-character {
    width: 120px;
    height: 120px;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: bounce 1s infinite alternate;
}

@keyframes bounce {
    0% { transform: translateY(0); }
    100% { transform: translateY(-10px); }
}

.message-character img {
    max-width: 100%;
    max-height: 100%;
}

.message-text {
    font-size: 22px;
    margin-bottom: 25px;
    color: #333;
    font-weight: 600;
    line-height: 1.4;
}

.message-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.message-btn {
    padding: 12px 25px;
    border-radius: 50px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #4c5eaf, #4a60c3);
    color: white;
    box-shadow: 0 4px 10px rgba(76, 86, 175, 0.3);
}

.message-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(76, 78, 175, 0.4);
}

.message-btn.hidden {
    display: none;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #f0f;
    opacity: 0.8;
    border-radius: 0;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(500px) rotate(360deg);
        opacity: 0;
    }
}

.win-title {
    font-size: 32px;
    color: #4CAF50;
    margin-bottom: 15px;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.error-title {
    font-size: 32px;
    color: #FF5252;
    margin-bottom: 15px;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.victory-container {
    text-align: center;
    padding: 20px;
}

.victory-icon {
    font-size: 60px;
    margin-bottom: 20px;
    color: #4CAF50;
    animation: victoryPulse 1.5s infinite;
}

@keyframes victoryPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.victory-title {
    font-size: 36px;
    color: #4CAF50;
    margin-bottom: 10px;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.victory-text {
    font-size: 20px;
    margin-bottom: 25px;
    color: #333;
    line-height: 1.4;
}

.hidden {
    display: none !important;
}

.assistant-in-message {
    width: 100px;
    height: 100px;
    margin: 0 auto 15px;
    animation: bounce 1s infinite alternate;
}

.assistant-in-message img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Efeito de destaque para a cor correta */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(76, 175, 80, 0); }
    100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
}

.highlight-correct {
    animation: pulse 2s infinite;
}

/* ================= RESPONSIVIDADE ================= */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .game-container {
        width: 90%;
        max-width: 700px;
        height: auto;
        min-height: 600px;
    }
    
    .colors-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
    
    .color-btn {
        height: 90px;
    }
    
    .game-header h2 {
        font-size: 24px;
    }
    
    .target-display {
        font-size: 20px;
        margin-bottom: 20px;
    }
}

/* Tablet Pequeno (600px - 768px) */
@media (max-width: 768px) {
    .game-container {
        width: 95%;
        margin: 10px auto 30px;
        border-radius: 15px;
    }
    
    .game-header {
        padding: 15px;
    }
    
    .game-header h2 {
        font-size: 22px;
    }
    
    .header-controls {
        gap: 10px;
    }
    
    .control-btn {
        width: 35px;
        height: 35px;
    }
    
    .control-btn img {
        width: 20px;
        height: 20px;
    }
    
    .game-content {
        padding: 20px;
    }
    
    .colors-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .color-btn {
        height: 80px;
        border-radius: 12px;
    }
    
    .target-display {
        font-size: 18px;
    }
    
    .message-content {
        padding: 25px 20px;
    }
    
    .message-text {
        font-size: 20px;
    }
    
    .victory-icon {
        font-size: 50px;
    }
    
    .victory-title {
        font-size: 28px;
    }
    
    .victory-text {
        font-size: 18px;
    }
}

/* Celular (480px - 600px) */
@media (max-width: 600px) {
    .game-container {
        width: 100%;
        height: 100vh;
        margin: 0;
        border-radius: 0;
        box-shadow: none;
        display: flex;
        flex-direction: column;
    }
    
    .colors-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .color-btn {
        height: 70px;
    }
    
    .game-header h2 {
        font-size: 20px;
    }
    
    .target-display {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .message-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .message-btn {
        width: 100%;
    }
    
    .btn-voltar {
        width: 100%;
        text-align: center;
    }
}

/* Celular Pequeno (até 480px) */
@media (max-width: 480px) {
    .game-header {
        padding: 12px;
    }
    
    .game-header h2 {
        font-size: 18px;
    }
    
    .header-controls {
        gap: 8px;
    }
    
    .control-btn {
        width: 30px;
        height: 30px;
    }
    
    .control-btn img {
        width: 16px;
        height: 16px;
    }
    
    .game-content {
        padding: 15px;
    }
    
    .colors-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .color-btn {
        height: 60px;
        border-radius: 10px;
    }
    
    .target-display {
        font-size: 16px;
    }
    
    .target-color {
        padding: 4px 8px;
        font-size: 14px;
    }
    
    .game-footer {
        padding: 15px;
    }
    
    .btn-voltar {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .message-content {
        padding: 20px 15px;
        margin: 15px;
    }
    
    .message-text {
        font-size: 18px;
    }
    
    .message-character {
        width: 80px;
        height: 80px;
    }
    
    .assistant-in-message {
        width: 80px;
        height: 80px;
    }
    
    .victory-icon {
        font-size: 40px;
    }
    
    .victory-title {
        font-size: 24px;
    }
    
    .victory-text {
        font-size: 16px;
    }
    
    .win-title, .error-title {
        font-size: 26px;
    }
}

/* Orientação paisagem em celulares */
@media (max-height: 600px) and (orientation: landscape) {
    .game-container {
        height: auto;
        min-height: 100vh;
    }
    
    .game-header {
        padding: 10px;
    }
    
    .game-content {
        padding: 15px;
    }
    
    .colors-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
    
    .color-btn {
        height: 60px;
    }
    
    .target-display {
        margin-bottom: 15px;
    }
}

/* Telas muito pequenas (até 320px) */
@media (max-width: 320px) {
    .colors-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .color-btn {
        height: 50px;
    }
    
    .game-header h2 {
        font-size: 16px;
    }
    
    .target-display {
        font-size: 14px;
    }
    
    .message-content {
        padding: 15px 10px;
    }
    
    .message-text {
        font-size: 16px;
    }
}