body {
    font-family: 'Inter', sans-serif;
    overscroll-behavior: none;
    user-select: none; /* Previne seleção de texto em TV */
    -webkit-user-select: none;
    -webkit-touch-callout: none; /* Desabilita menu de contexto no iOS */
}
.font-title {
    font-family: 'Poppins', sans-serif;
}
.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

/* Otimizações para TV TouchScreen */
@media (min-width: 1920px) {
    .game-card {
        height: 160px !important;
        width: 160px !important;
        min-height: 160px;
        min-width: 160px;
        max-height: 160px;
        max-width: 160px;
        padding: 1.2rem !important;
        margin: 0.3rem !important;
        flex-shrink: 0; /* Impede que os cards encolham */
        flex-grow: 0; /* Impede que os cards cresçam */
    }
    
    .game-card i {
        font-size: 3.5rem !important;
    }
    
    .game-card h2 {
        font-size: 1.3rem !important;
        line-height: 1.2;
    }
    
    button {
        min-height: 60px;
        font-size: 1.25rem;
        padding: 1rem 2rem;
    }
}

/* Uniformização para todas as telas */
.game-card {
    aspect-ratio: 1 / 1 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    min-width: 140px !important;
    width: 140px !important;
    height: 140px !important;
}

/* Feedback visual aprimorado */
.glass-card:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
    transform: scale(1.05) translateY(-5px);
}

.glass-card:active {
    transform: scale(0.98);
    background: rgba(255, 255, 255, 0.25);
}

/* Sistema de Feedback Tátil e Visual Aprimorado */
.touch-feedback {
    position: relative;
    overflow: hidden;
}

.touch-feedback::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.touch-feedback:active::before {
    width: 300px;
    height: 300px;
}

/* Animações de pulso para elementos interativos */
@keyframes pulse-glow {
    0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4); }
    70% { box-shadow: 0 0 0 20px rgba(255, 255, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

.pulse-on-hover:hover {
    animation: pulse-glow 1.5s infinite;
}

/* Feedback sonoro visual */
.sound-feedback {
    position: relative;
}

.sound-feedback::after {
    content: '♪';
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 1.5rem;
    color: #fbbf24;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
}

.sound-feedback:active::after {
    opacity: 1;
    transform: scale(1) translateY(-10px);
}

/* Estados de loading e processamento */
.processing {
    pointer-events: none;
    opacity: 0.7;
    position: relative;
}

.processing::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #ffffff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Feedback para acertos e erros */
.success-feedback {
    animation: success-pulse 0.6s ease-out;
    border-color: #10b981 !important;
    background: rgba(16, 185, 129, 0.2) !important;
}

.error-feedback {
    animation: error-shake 0.6s ease-out;
    border-color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.2) !important;
}

@keyframes success-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); box-shadow: 0 0 20px rgba(16, 185, 129, 0.6); }
    100% { transform: scale(1); }
}

@keyframes error-shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Otimizações de Performance para TV */
.reduced-motion * {
    animation-duration: 0.2s !important;
    transition-duration: 0.2s !important;
}

.low-performance .glass-card {
    backdrop-filter: none;
    background: rgba(255, 255, 255, 0.1) !important;
}

.low-performance .pulse-on-hover {
    animation: none !important;
}

/* Aceleração de hardware para elementos críticos */
.glass-card,
.game-card {
    will-change: transform;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
}

/* Otimizações para telas grandes de TV */
@media screen and (min-width: 1920px) {
    /* Reduzir blur em telas muito grandes para melhor performance */
    .glass-card {
        backdrop-filter: blur(5px);
    }
    
    /* Otimizar gradientes para TVs */
    body {
        background-attachment: fixed;
        background-size: 100% 100%;
    }
}

/* Prefers-reduced-motion para acessibilidade */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Sistema de Pontuação */
@keyframes scoreFloat {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
    50% {
        opacity: 1;
        transform: translateX(-50%) translateY(-20px) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-40px) scale(0.8);
    }
}

.score-animation {
    animation: scoreFloat 2s ease-out forwards;
}

#score-display {
    position: relative;
    overflow: visible;
}

/* Ranking Styles */
#ranking-list .glass-card:nth-child(1) {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.1));
    border-color: rgba(255, 215, 0, 0.5);
}

#ranking-list .glass-card:nth-child(2) {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.2), rgba(192, 192, 192, 0.1));
    border-color: rgba(192, 192, 192, 0.5);
}

#ranking-list .glass-card:nth-child(3) {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.2), rgba(205, 127, 50, 0.1));
    border-color: rgba(205, 127, 50, 0.5);
}

/* Game Icons */
.game-icon {
    display: block;
    font-size: 2.5rem;
    line-height: 1;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.2));
    transition: all 0.3s ease;
}

.game-card:hover .game-icon {
    transform: scale(1.1);
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.4));
}

@media (min-width: 1024px) {
    .game-icon {
        font-size: 3rem;
        margin-bottom: 0.75rem;
    }
}

::-webkit-scrollbar {
    display: none;
}
#wordsearch-grid {
    touch-action: none;
}
.selected-letter {
    background-color: #fbbf24 !important;
    color: #1f2937;
}
.found-word {
    background-color: #34d399 !important;
    color: #1f2937;
    transition: background-color 0.3s ease;
}
.memory-card {
    transform-style: preserve-3d;
    transition: transform 0.5s;
}
.memory-card.flipped {
    transform: rotateY(180deg);
}
.memory-card .front, .memory-card .back {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}
.memory-card .front {
    transform: rotateY(180deg);
}
.qr-code img {
    margin: auto;
    border-radius: 8px;
    background: white;
    padding: 8px;
}
#puzzle-canvas {
    cursor: grab;
    touch-action: none;
}
@keyframes gradient-xy {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}
.animate-gradient-xy {
    background-size: 200% 200%;
    animation: gradient-xy 15s ease infinite;
}
body {
    font-family: 'Inter', sans-serif;
    overscroll-behavior: none;
}
.font-title {
    font-family: 'Poppins', sans-serif;
}
.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}
::-webkit-scrollbar {
    display: none;
}
#wordsearch-grid {
    touch-action: none;
}
.selected-letter {
    background-color: #fbbf24 !important;
    color: #1f2937;
}
.found-word {
    background-color: #34d399 !important;
    color: #1f2937;
    transition: background-color 0.3s ease;
}
.memory-card {
    transform-style: preserve-3d;
    transition: transform 0.5s;
}
.memory-card.flipped {
    transform: rotateY(180deg);
}
.memory-card .front, .memory-card .back {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}
.memory-card .front {
    transform: rotateY(180deg);
}
.qr-code img {
    margin: auto;
    border-radius: 8px;
    background: white;
    padding: 8px;
}
@keyframes gradient-xy {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}
.animate-gradient-xy {
    background-size: 200% 200%;
    animation: gradient-xy 15s ease infinite;
}

/* --- NOVOS ESTILOS ADICIONADOS --- */
.difference-marker {
    position: absolute;
    border: 3px solid #fde047; /* yellow-300 */
    border-radius: 50%;
    background-color: rgba(253, 224, 71, 0.3);
    pointer-events: none;
    transform: translate(-50%, -50%);
}
.draggable-item {
    cursor: grab;
    user-select: none;
}
.draggable-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
}
.drop-target {
    transition: background-color 0.2s ease-in-out;
}
.drop-target.over {
    background-color: rgba(255, 255, 255, 0.2);
}
.drop-target.matched {
    border-color: #34d399; /* emerald-400 */
    background-color: rgba(52, 211, 153, 0.3);
}