/**
 * Estilos principales de Facilmente
 */

/* Contenedor principal del juego */
.facilmente-game-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.facilmente-game-header {
    text-align: center;
    margin-bottom: 30px;
}

.facilmente-game-header h2 {
    font-size: 2em;
    margin-bottom: 10px;
}

.facilmente-game-meta {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.facilmente-game-meta span {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: bold;
}

.difficulty {
    text-transform: uppercase;
}

.difficulty-facil {
    background: #4caf50;
    color: white;
}

.difficulty-medio {
    background: #ff9800;
    color: white;
}

.difficulty-dificil {
    background: #f44336;
    color: white;
}

.game-type {
    background: #2196f3;
    color: white;
}

.time-limit {
    background: #9e9e9e;
    color: white;
}

/* Área de juego */
.facilmente-game-area {
    background: #f5f5f5;
    border-radius: 10px;
    padding: 30px;
    margin-top: 20px;
}

.facilmente-celebration {
    position: relative;
    height: 0;
    pointer-events: none;
}

.facilmente-celebration.active {
    height: 120px;
    margin-bottom: 10px;
}

.celebration-star {
    position: absolute;
    top: 0;
    font-size: 1.6rem;
    animation: celebrate-float 1.8s ease-out forwards;
}

@keyframes celebrate-float {
    0% { transform: translateY(0) scale(0.8); opacity: 0; }
    20% { opacity: 1; }
    100% { transform: translateY(-90px) scale(1.1); opacity: 0; }
}

.facilmente-game-intro {
    text-align: center;
    background: linear-gradient(135deg, #fff6d5 0%, #e3f2fd 100%);
    border-radius: 16px;
    padding: 30px 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 20px rgba(33, 150, 243, 0.15);
}

.facilmente-game-intro .intro-badge {
    width: 70px;
    height: 70px;
    margin: 0 auto 10px;
    border-radius: 50%;
    background: #fff;
    display: grid;
    place-items: center;
    font-size: 2rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.facilmente-game-intro h3 {
    font-size: 1.8rem;
    margin: 10px 0 8px;
    color: #1e4e8c;
}

.facilmente-game-intro p {
    font-size: 1.1rem;
    margin-bottom: 18px;
    color: #34495e;
}

.facilmente-game-intro .button-primary {
    font-size: 1.1rem;
    padding: 10px 28px;
    border-radius: 999px;
    background: #ff9800;
    border-color: #ff9800;
    box-shadow: 0 6px 0 #f57c00;
}

.facilmente-game-intro .button-primary:hover {
    background: #ffa726;
    border-color: #ffa726;
}

.facilmente-game-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.facilmente-game-progress {
    margin: 10px 0 20px;
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
    border-radius: 14px;
    padding: 10px 14px;
    border: 1px solid rgba(33, 150, 243, 0.15);
    box-shadow: 0 6px 14px rgba(0,0,0,0.08), inset 0 2px 0 rgba(255,255,255,0.7);
}

.facilmente-game-progress .progress-label {
    font-weight: 700;
    color: #1e4e8c;
    margin-bottom: 6px;
}

.facilmente-game-progress .progress-bar {
    width: 100%;
    height: 12px;
    border-radius: 999px;
    background: #e3edff;
    overflow: hidden;
}

.facilmente-game-progress .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #8bc34a);
    border-radius: 999px;
    transition: width 0.3s ease;
}

.facilmente-game-timer,
.facilmente-game-score {
    font-size: 1.2em;
    font-weight: bold;
}

.facilmente-game-canvas {
    min-height: 400px;
    background: linear-gradient(160deg, #fef9e7 0%, #e3f2fd 100%);
    border-radius: 5px;
    padding: 20px;
    border: 1px solid rgba(33, 150, 243, 0.2);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 8px 20px rgba(33, 150, 243, 0.15);
}

.facilmente-panel {
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
    border-radius: 16px;
    padding: 18px 20px;
    margin-bottom: 18px;
    border: 1px solid rgba(33, 150, 243, 0.15);
    box-shadow: 0 6px 14px rgba(0,0,0,0.08), inset 0 2px 0 rgba(255,255,255,0.7);
}

.facilmente-panel .intro-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #fff3cd;
    display: grid;
    place-items: center;
    font-size: 1.8rem;
    margin-bottom: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}

.facilmente-input {
    width: 100%;
    max-width: 320px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 2px solid rgba(33, 150, 243, 0.25);
    background: #fffdf7;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.08);
    font-size: 1rem;
}

.facilmente-input:focus {
    outline: none;
    border-color: #ff9800;
    box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.25);
}

.language-game .intro-icon {
    background: #fff3cd;
}

.language-game .scrambled-title {
    font-weight: bold;
    color: #1e4e8c;
    margin-bottom: 10px;
}

.language-game .letters-container .scrambled-letters {
    font-size: 1.8rem;
    font-weight: bold;
    letter-spacing: 0.2rem;
    background: #fff;
    border-radius: 12px;
    padding: 12px 16px;
    display: inline-block;
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.7), 0 4px 10px rgba(0,0,0,0.1);
}

.language-game .word-input {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 14px;
}

.language-game .check-word {
    background: #4caf50;
    border-color: #4caf50;
    box-shadow: 0 6px 0 #388e3c;
    color: #fff;
    border-radius: 999px;
    padding: 8px 22px;
    font-size: 1rem;
}

.language-game .check-word:hover {
    background: #66bb6a;
    border-color: #66bb6a;
}

.word-builder-game .intro-icon {
    background: #e3f2fd;
}

.word-builder-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    font-weight: 600;
    color: #1e4e8c;
}

.word-builder-slots {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.word-builder-slots .word-slot {
    width: 42px;
    height: 48px;
    border-radius: 12px;
    border: 2px dashed rgba(30, 78, 140, 0.3);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: bold;
    color: #1e4e8c;
}

.word-builder-slots .word-slot.filled {
    border-style: solid;
    background: #fff7e6;
}

.word-builder-bank {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.word-builder-bank .letter-chip {
    border: none;
    background: #ff9800;
    color: #fff;
    padding: 10px 14px;
    border-radius: 999px;
    font-weight: 600;
    box-shadow: 0 6px 0 #e68900;
    cursor: pointer;
}

.word-builder-bank .letter-chip.used,
.word-builder-bank .letter-chip:disabled {
    background: #cfd8dc;
    box-shadow: none;
    cursor: not-allowed;
}

.word-builder-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.word-builder-actions .button {
    border-radius: 999px;
    padding: 8px 20px;
}

.maze-game .intro-icon {
    background: #ede7f6;
}

.maze-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    font-weight: 600;
    color: #4a148c;
}

.maze-board {
    display: grid;
    gap: 2px;
    background: #f3e5f5;
    padding: 10px;
    border-radius: 14px;
    margin-bottom: 16px;
}

.maze-cell {
    position: relative;
    background: #fff;
    border-radius: 6px;
    min-width: 28px;
    min-height: 28px;
}

.maze-cell.wall-top {
    border-top: 3px solid #7e57c2;
}

.maze-cell.wall-right {
    border-right: 3px solid #7e57c2;
}

.maze-cell.wall-bottom {
    border-bottom: 3px solid #7e57c2;
}

.maze-cell.wall-left {
    border-left: 3px solid #7e57c2;
}

.maze-cell.player::after {
    content: '🧒';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.maze-cell.goal::after {
    content: '⭐';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.maze-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.maze-controls-row {
    display: flex;
    gap: 10px;
}

.maze-controls .button {
    border-radius: 999px;
    padding: 8px 18px;
}

.word-puzzle-game .intro-icon {
    background: #fce4ec;
}

.word-puzzle-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    font-weight: 600;
    color: #880e4f;
}

.word-puzzle-figure {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.word-puzzle-image {
    width: 220px;
    max-width: 100%;
    border-radius: 18px;
    background: #fffafc;
    box-shadow: 0 10px 24px rgba(136, 14, 79, 0.12);
}

.word-puzzle-slots {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.word-puzzle-slot {
    width: 42px;
    height: 48px;
    border-radius: 12px;
    border: 2px dashed rgba(136, 14, 79, 0.3);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: bold;
    color: #880e4f;
}

.word-puzzle-slot.fixed {
    border-style: solid;
    background: #fce4ec;
}

.word-puzzle-slot.missing {
    border-style: dashed;
    background: #fffafc;
}

.word-puzzle-bank {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.word-puzzle-bank .puzzle-letter {
    border: none;
    background: #ec407a;
    color: #fff;
    padding: 10px 16px;
    border-radius: 999px;
    font-weight: 600;
    box-shadow: 0 6px 0 #d81b60;
    cursor: pointer;
}

.word-puzzle-bank .puzzle-letter.used,
.word-puzzle-bank .puzzle-letter:disabled {
    background: #cfd8dc;
    box-shadow: none;
    cursor: not-allowed;
}

.word-puzzle-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.word-puzzle-actions .button {
    border-radius: 999px;
    padding: 8px 20px;
}

.scene-builder-game .intro-icon {
    background: #e8eaf6;
}

.scene-builder-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    font-weight: 600;
    color: #1a237e;
}

.scene-builder-preview {
    min-height: 10px;
}

.scene-builder-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.scene-builder-group-title {
    font-weight: 700;
    color: #1a237e;
    text-transform: capitalize;
    margin-bottom: 8px;
}

.scene-builder-group-items {
    display: grid;
    grid-template-columns: repeat(var(--scene-grid-columns, 3), minmax(120px, 1fr));
    gap: 12px;
}

.scene-option {
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    border-radius: 16px;
}

.scene-option img {
    width: 140px;
    height: 120px;
    display: block;
    border-radius: 16px;
    box-shadow: 0 8px 18px rgba(26, 35, 126, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.scene-option.selected img {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 26px rgba(26, 35, 126, 0.25);
    outline: 3px solid #5c6bc0;
    outline-offset: 4px;
}

.scene-builder-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.scene-builder-actions .button {
    border-radius: 999px;
    padding: 8px 20px;
}

.memory-board-panel .memory-game-board {
    margin: 0;
}

.attention-board {
    padding: 12px;
}

.logic-game .pattern-display,
.calculation-game .equation-display {
    font-size: 1.6rem;
    font-weight: bold;
    background: #fff;
    border-radius: 12px;
    padding: 12px 16px;
    display: inline-block;
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.7), 0 4px 10px rgba(0,0,0,0.1);
    margin-bottom: 12px;
}

.logic-game .puzzle-options .button,
.calculation-game .check-answer {
    background: #2196f3;
    border-color: #2196f3;
    box-shadow: 0 6px 0 #1976d2;
    color: #fff;
    border-radius: 999px;
    padding: 8px 20px;
    margin: 6px 6px 0 0;
}

.logic-game .puzzle-options .button:hover,
.calculation-game .check-answer:hover {
    background: #42a5f5;
    border-color: #42a5f5;
}

.calculation-game .math-input {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

/* Resultados */
.facilmente-game-results {
    text-align: center;
    padding: 30px;
    background: #e8f5e9;
    border-radius: 10px;
}

.facilmente-game-results .button {
    font-size: 1rem;
    padding: 8px 22px;
    border-radius: 999px;
    box-shadow: 0 6px 0 #b0bec5, 0 10px 18px rgba(0,0,0,0.08);
    margin-right: 10px;
}

.facilmente-game-results h3 {
    color: #4caf50;
    font-size: 2em;
    margin-bottom: 20px;
}

.facilmente-game-results .final-score,
.facilmente-game-results .final-time {
    font-size: 1.3em;
    margin: 10px 0;
}

/* Modal de juegos */
.facilmente-game-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.facilmente-game-modal.is-active {
    display: flex;
}

.facilmente-game-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
}

.facilmente-game-modal-content {
    position: relative;
    max-width: 980px;
    width: min(92vw, 980px);
    max-height: 90vh;
    overflow: auto;
    background: linear-gradient(160deg, #fef9e7 0%, #e3f2fd 100%);
    border-radius: 18px;
    padding: 20px;
    border: 1px solid rgba(33, 150, 243, 0.2);
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
    z-index: 1;
}

.facilmente-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #ff5252;
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: 0 6px 0 #d32f2f;
}

.facilmente-modal-close:hover {
    background: #ff6f6f;
}

.facilmente-modal-loading,
.facilmente-modal-error {
    text-align: center;
    font-size: 1.1rem;
    padding: 30px 10px;
    color: #1e4e8c;
}

/* Lista de juegos */
.facilmente-games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.facilmente-game-card {
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
    border: 1px solid rgba(33, 150, 243, 0.2);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 6px 14px rgba(0,0,0,0.08), inset 0 2px 0 rgba(255,255,255,0.8);
}

.facilmente-game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(33, 150, 243, 0.2);
}

.facilmente-game-card .game-thumbnail img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid rgba(33, 150, 243, 0.15);
}

.facilmente-game-card .game-content {
    padding: 20px;
}

.facilmente-game-card h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #1e4e8c;
}

.facilmente-game-card .game-meta {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.facilmente-game-card .game-actions {
    margin-top: 15px;
}

.facilmente-game-card .button-primary {
    border-radius: 999px;
    padding: 8px 22px;
    background: #ff9800;
    border-color: #ff9800;
    box-shadow: 0 6px 0 #f57c00;
}

.facilmente-game-card .button-primary:hover {
    background: #ffa726;
    border-color: #ffa726;
}

/* Progreso de usuario */
.facilmente-user-progress {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.progress-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.stat-box {
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
    border: 2px solid rgba(33, 150, 243, 0.15);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 6px 14px rgba(0,0,0,0.08), inset 0 2px 0 rgba(255,255,255,0.7);
}

.stat-box h4 {
    margin: 0 0 10px 0;
    color: #666;
    font-size: 0.9em;
    text-transform: uppercase;
}

.stat-number {
    font-size: 2.5em;
    font-weight: bold;
    color: #2196f3;
    margin: 0;
}

.skills-progress {
    margin-top: 30px;
}

.skill-item {
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
    border: 1px solid rgba(33, 150, 243, 0.15);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 6px 14px rgba(0,0,0,0.08), inset 0 2px 0 rgba(255,255,255,0.7);
}

.skill-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.skill-level {
    background: #2196f3;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
}

.skill-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    color: #666;
}

.skill-progress-bar {
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #8bc34a);
    transition: width 0.3s ease;
}

.skill-last-played {
    color: #999;
    font-size: 0.9em;
    margin: 0;
}

/* Tabla de clasificación */
.facilmente-leaderboard {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.facilmente-leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
    box-shadow: 0 8px 18px rgba(33, 150, 243, 0.15);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(33, 150, 243, 0.2);
}

.facilmente-leaderboard-table th {
    background: #5c9dff;
    color: white;
    padding: 15px;
    text-align: left;
}

.facilmente-leaderboard-table td {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.facilmente-leaderboard-table tr:hover {
    background: #f5f5f5;
}

.facilmente-leaderboard-table tr.current-user {
    background: #e3f2fd;
    font-weight: bold;
}

.facilmente-leaderboard-table .rank {
    width: 80px;
    text-align: center;
    font-weight: bold;
}

.trophy {
    font-size: 1.5em;
}

.you-badge {
    background: #4caf50;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8em;
    margin-left: 10px;
}

/* Juegos específicos */

/* Juego de Memoria */
.memory-game-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin: 20px 0;
}

.memory-card {
    aspect-ratio: 1;
    background: #2196f3;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    transition: transform 0.3s;
}

.memory-card:hover {
    transform: scale(1.05);
}

.memory-card.flipped {
    background: white;
    border: 2px solid #2196f3;
}

.memory-card.matched {
    background: #4caf50;
    cursor: default;
}

/* Juego de Atención */
.attention-game-area {
    position: relative;
    height: 400px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    overflow: hidden;
}

.attention-target {
    position: absolute;
    width: 50px;
    height: 50px;
    background: #ffd700;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.attention-target:hover {
    transform: scale(1.2);
}

.attention-miss {
    position: absolute;
    transform: translate(-50%, -50%);
    font-size: 1.8rem;
    color: #ff1744;
    font-weight: bold;
    text-shadow: 0 2px 6px rgba(0,0,0,0.2);
    pointer-events: none;
}

/* Juego de Secuencias */
.sequence-instructions {
    margin-bottom: 18px;
}

.sequence-instructions h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #1e4e8c;
}

.sequence-status {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 15px;
    font-weight: bold;
}

.sequence-display {
    text-align: center;
    font-size: 1.1em;
    margin: 10px 0 18px;
}

.sequence-countdown {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.1em;
    color: #1e4e8c;
    margin-bottom: 16px;
}

.sequence-countdown-spinner {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 3px solid rgba(33, 150, 243, 0.2);
    border-top-color: #2196f3;
    animation: sequence-spin 0.9s linear infinite;
}

.sequence-countdown-text {
    min-width: 24px;
    text-align: center;
}

@keyframes sequence-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.sequence-display.sequence-status-success {
    color: #2e7d32;
    animation: sequence-bounce 0.5s ease;
}

.sequence-display.sequence-status-error {
    color: #d32f2f;
    animation: sequence-shake 0.45s ease;
}

@keyframes sequence-bounce {
    0% { transform: scale(1); }
    40% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

@keyframes sequence-shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    50% { transform: translateX(6px); }
    75% { transform: translateX(-4px); }
    100% { transform: translateX(0); }
}

.sequence-pad-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 15px;
    max-width: 520px;
    margin: 0 auto 20px;
}

.sequence-pad {
    border: none;
    border-radius: 16px;
    height: 120px;
    cursor: pointer;
    box-shadow: inset 0 -6px 0 rgba(0,0,0,0.2);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.sequence-pad:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.sequence-pad.active {
    transform: translateY(2px) scale(0.98);
    box-shadow: inset 0 -2px 0 rgba(0,0,0,0.2);
}

.sequence-showing .sequence-pad.active {
    opacity: 1;
    filter: saturate(1.2) brightness(1.15);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6), 0 0 0 3px rgba(255,255,255,0.6) inset;
    transform: scale(1.04);
    animation: sequence-pulse 0.7s ease-in-out infinite;
}

@keyframes sequence-pulse {
    0% {
        transform: scale(1.02);
        box-shadow: 0 0 16px rgba(255, 215, 0, 0.45), 0 0 0 3px rgba(255,255,255,0.5) inset;
    }
    50% {
        transform: scale(1.07);
        box-shadow: 0 0 26px rgba(255, 215, 0, 0.7), 0 0 0 4px rgba(255,255,255,0.7) inset;
    }
    100% {
        transform: scale(1.02);
        box-shadow: 0 0 16px rgba(255, 215, 0, 0.45), 0 0 0 3px rgba(255,255,255,0.5) inset;
    }
}

.sequence-pad.pad-0 { background: #2196f3; }
.sequence-pad.pad-1 { background: #f44336; }
.sequence-pad.pad-2 { background: #4caf50; }
.sequence-pad.pad-3 { background: #ffeb3b; }

.sequence-actions {
    text-align: center;
    margin-top: 6px;
}

.sequence-actions .button {
    background: #2196f3;
    border-color: #2196f3;
    color: #fff;
    border-radius: 999px;
    padding: 10px 22px;
    box-shadow: 0 6px 0 #1976d2;
    font-weight: 600;
}

.sequence-actions .button:hover {
    background: #42a5f5;
    border-color: #42a5f5;
}

.sequence-actions .button:disabled {
    opacity: 0.7;
    box-shadow: none;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 768px) {
    .facilmente-game-container,
    .facilmente-game-area,
    .facilmente-game-canvas {
        max-width: 100%;
        width: 100%;
    }

    .facilmente-games-grid {
        grid-template-columns: 1fr;
    }
    
    .memory-game-board {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .progress-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .sequence-pad {
        height: 100px;
    }

    .facilmente-game-container {
        padding: 12px;
    }

    .facilmente-game-area {
        padding: 18px;
    }

    .facilmente-game-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .facilmente-game-progress .progress-label {
        font-size: 0.95rem;
    }

    .facilmente-panel {
        padding: 14px 16px;
    }

    .language-game .letters-container .scrambled-letters,
    .word-builder-slots .word-slot,
    .logic-game .pattern-display,
    .calculation-game .equation-display {
        font-size: 1.4rem;
        letter-spacing: 0.1rem;
    }

    .attention-game-area {
        height: 320px;
    }

    .sequence-pad-grid {
        max-width: 100%;
        grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    }
}

@media (max-width: 480px) {
    .facilmente-game-container,
    .facilmente-game-area,
    .facilmente-game-canvas {
        max-width: 100%;
        width: 100%;
    }
    .facilmente-game-header h2 {
        font-size: 1.6rem;
    }

    .facilmente-game-meta {
        gap: 8px;
    }

    .memory-game-board {
        grid-template-columns: repeat(2, 1fr);
    }

    .memory-card {
        font-size: 1.6rem;
    }

    .attention-game-area {
        height: 260px;
    }

    .sequence-pad {
        height: 90px;
    }

    .facilmente-input {
        max-width: 100%;
    }

    .language-game .word-input,
    .calculation-game .math-input,
    .word-builder-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .logic-game .puzzle-options .button,
    .calculation-game .check-answer,
    .language-game .check-word,
    .word-builder-actions .button,
    .sequence-actions .button {
        width: 100%;
        text-align: center;
    }
}

.facilmente-login-register {
    place-self: center;
}