/* Reset e configurações base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Paleta de cores futurista e disruptiva */
    --primary-bg: #0a0a0f;
    --secondary-bg: #1a1a2e;
    --accent-bg: #16213e;
    --card-bg: #0f3460;
    --primary-text: #00ff88;
    --secondary-text: #64ffda;
    --accent-text: #00d4ff;
    --success-color: #00ff88;
    --warning-color: #ffaa00;
    --danger-color: #ff4444;
    --border-color: #2a2a3e;
    --glow-color: #00d4ff;
    --card-back: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --neon-green: #39ff14;
    --neon-blue: #00ffff;
    --neon-purple: #bf00ff;
    
    /* Sombras e efeitos */
    --box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --glow-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
    --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    --neon-glow: 0 0 10px currentColor, 0 0 20px currentColor, 0 0 30px currentColor;
    
    /* Transições */
    --transition-fast: 0.2s ease;
    --transition-medium: 0.4s ease;
    --transition-slow: 0.6s ease;
}

body {
    font-family: 'Exo 2', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--primary-bg);
    color: var(--accent-text);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Sistema de partículas de fundo */
.particles-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--neon-blue);
    border-radius: 50%;
    animation: particleFloat linear infinite;
    opacity: 0.6;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-10vh) translateX(50px);
        opacity: 0;
    }
}

/* Fundo animado futurista */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(0, 212, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(233, 69, 96, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(0, 255, 136, 0.05) 0%, transparent 50%);
    z-index: -1;
    animation: backgroundPulse 4s ease-in-out infinite alternate;
}

@keyframes backgroundPulse {
    0% { opacity: 0.3; }
    100% { opacity: 0.6; }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--secondary-bg);
    border-radius: 20px;
    border: 2px solid var(--border-color);
    box-shadow: var(--box-shadow);
    position: relative;
    overflow: hidden;
}

.credits {
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: 10px;
    padding: 8px 15px;
    margin-bottom: 15px;
    position: relative;
    z-index: 2;
}

.credits p {
    font-size: 0.9rem;
    color: var(--success-color);
    margin: 0;
    font-weight: 500;
    text-shadow: 0 0 5px rgba(0, 255, 136, 0.3);
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.1), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.title {
    margin-bottom: 20px;
}

.title-main {
    display: block;
    font-family: 'Orbitron', monospace;
    font-size: 2.8rem;
    font-weight: 900;
    color: var(--primary-text);
    text-shadow: var(--neon-glow);
    margin-bottom: 5px;
    animation: titlePulse 2s ease-in-out infinite alternate;
}

.title-sub {
    display: block;
    font-size: 1rem;
    color: var(--secondary-text);
    font-weight: 300;
    letter-spacing: 3px;
    text-transform: uppercase;
    opacity: 0.8;
}

@keyframes titlePulse {
    0% { text-shadow: var(--neon-glow); }
    100% { text-shadow: 0 0 5px currentColor, 0 0 10px currentColor, 0 0 15px currentColor; }
}

/* Seletor de nível */
.level-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--accent-bg);
    border-radius: 15px;
    border: 1px solid var(--border-color);
}

.level-label {
    font-family: 'Orbitron', monospace;
    font-weight: 600;
    color: var(--secondary-text);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.level-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.level-btn {
    background: var(--primary-text);
    color: var(--primary-bg);
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
    transition: var(--transition-medium);
    display: flex;
    align-items: center;
    justify-content: center;
}

.level-btn:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 0 15px var(--primary-text);
}

.level-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.level-display {
    font-family: 'Orbitron', monospace;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-text);
    text-shadow: 0 0 10px var(--primary-text);
    min-width: 40px;
    text-align: center;
}

.level-info {
    font-size: 0.9rem;
    color: var(--secondary-text);
    opacity: 0.8;
}

.game-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 20px;
    background: var(--accent-bg);
    border-radius: 15px;
    border: 1px solid var(--border-color);
    min-width: 100px;
    transition: var(--transition-medium);
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow-shadow);
    border-color: var(--glow-color);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--secondary-text);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-text);
    text-shadow: 0 0 5px rgba(0, 212, 255, 0.3);
}

/* Game Area */
.game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

/* Start Screen */
.start-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    width: 100%;
}

.start-content {
    text-align: center;
    padding: 40px;
    background: var(--secondary-bg);
    border-radius: 25px;
    border: 2px solid var(--border-color);
    box-shadow: var(--box-shadow);
    max-width: 600px;
    position: relative;
    overflow: hidden;
}

.start-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 136, 0.1), transparent);
    animation: shimmer 3s infinite;
}

.logo-container {
    margin-bottom: 25px;
}

.logo-icon {
    font-size: 4rem;
    margin-bottom: 10px;
    animation: logoFloat 3s ease-in-out infinite;
}

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

.start-content h2 {
    font-family: 'Orbitron', monospace;
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--primary-text);
    text-shadow: var(--neon-glow);
    margin-bottom: 10px;
}

.mission-text {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 15px;
    color: var(--secondary-text);
    font-style: italic;
}

.game-info {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 10px;
    padding: 10px 15px;
    margin-bottom: 25px;
}

.game-info p {
    font-size: 0.9rem;
    color: var(--accent-text);
    margin: 0;
    line-height: 1.4;
}

.level-preview {
    background: var(--accent-bg);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 25px;
    border: 1px solid var(--border-color);
}

.level-preview h3 {
    font-family: 'Orbitron', monospace;
    font-size: 1.5rem;
    color: var(--primary-text);
    margin-bottom: 10px;
}

.level-preview p {
    color: var(--accent-text);
    margin-bottom: 15px;
}

.difficulty-bar {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.difficulty-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success-color), var(--accent-text));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.social-impact {
    margin-top: 20px;
    padding: 15px;
    background: rgba(0, 255, 136, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(0, 255, 136, 0.3);
}

.social-impact p {
    font-size: 0.9rem;
    color: var(--success-color);
    margin: 0;
}

.start-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.start-btn, .new-session-btn {
    border: none;
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition-medium);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--card-shadow);
    color: white;
}

.start-btn {
    background: linear-gradient(135deg, var(--primary-text), var(--warning-color));
}

.start-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 255, 136, 0.4);
}

.new-session-btn {
    background: linear-gradient(135deg, var(--accent-text), var(--secondary-text));
}

.new-session-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.4);
}

.start-btn:active, .new-session-btn:active {
    transform: translateY(-1px) scale(1.02);
}

.btn-icon {
    font-size: 1.3rem;
}

/* Game Board */
.game-board {
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
    max-width: 900px;
    width: 100%;
    padding: 20px;
}

.game-board.active {
    display: grid;
}

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

/* Cards */
.card {
    aspect-ratio: 1;
    background: var(--card-back);
    border-radius: 20px;
    cursor: pointer;
    position: relative;
    transform-style: preserve-3d;
    transition: all var(--transition-medium);
    border: 2px solid var(--border-color);
    box-shadow: var(--card-shadow);
}

.card:hover:not(.flipped):not(.matched) {
    transform: translateY(-8px) rotateY(15deg) scale(1.05);
    box-shadow: 0 15px 40px rgba(0, 212, 255, 0.3);
    border-color: var(--accent-text);
}

.card.flipped {
    transform: rotateY(180deg);
}

.card.matched {
    transform: scale(0.95);
    opacity: 0.8;
    border-color: var(--success-color);
    box-shadow: 0 0 25px rgba(0, 255, 136, 0.4);
    cursor: default;
    animation: matchedPulse 2s ease-in-out;
}

@keyframes matchedPulse {
    0%, 100% { 
        box-shadow: 0 0 25px rgba(0, 255, 136, 0.4);
        border-color: var(--success-color);
    }
    50% { 
        box-shadow: 0 0 35px rgba(0, 255, 136, 0.6);
        border-color: var(--neon-green);
    }
}

.card.matched::after {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--success-color);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    z-index: 10;
    animation: checkmarkPop 0.5s ease;
}

@keyframes checkmarkPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.card-back {
    background: var(--card-back);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.card-back::before {
    content: '🧩';
    font-size: 3rem;
    opacity: 0.8;
}

.card-front {
    background: white;
    transform: rotateY(180deg);
    position: relative;
}

.card-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
}

.card-names {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(10, 10, 15, 0.9) 100%);
    padding: 12px 8px 8px 8px;
    border-radius: 0 0 16px 16px;
    text-align: center;
}

.name-en {
    font-family: 'Orbitron', monospace;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-text);
    text-shadow: 0 0 8px var(--primary-text), 2px 2px 4px rgba(0, 0, 0, 0.8);
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.name-pt {
    font-size: 0.75rem;
    color: var(--secondary-text);
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.3s ease;
}

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

.modal-content {
    background: var(--secondary-bg);
    padding: 30px;
    border-radius: 25px;
    border: 2px solid var(--border-color);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.4s ease;
}

@keyframes modalSlideIn {
    from { transform: translateY(-50px) scale(0.9); }
    to { transform: translateY(0) scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.auto-close-timer {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    max-width: 200px;
}

.timer-bar {
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.timer-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--warning-color), var(--danger-color));
    border-radius: 2px;
    animation: timerCountdown 3s linear forwards;
}

@keyframes timerCountdown {
    from { width: 100%; }
    to { width: 0%; }
}

.timer-text {
    font-size: 0.8rem;
    color: var(--secondary-text);
    opacity: 0.8;
}

#timer-seconds {
    color: var(--warning-color);
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--accent-text);
    cursor: pointer;
    transition: var(--transition-fast);
    padding: 5px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--primary-text);
    transform: scale(1.1);
    background: rgba(0, 212, 255, 0.1);
}

.animal-info {
    display: flex;
    gap: 25px;
    align-items: flex-start;
}

.animal-image {
    flex: 0 0 220px;
    position: relative;
}

.animal-image img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 15px;
    border: 2px solid var(--border-color);
}

.status-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    text-shadow: none;
}

.animal-details {
    flex: 1;
}

.animal-name-en {
    font-family: 'Orbitron', monospace;
    font-size: 1.8rem;
    color: var(--primary-text);
    margin-bottom: 5px;
    text-shadow: 0 0 10px var(--primary-text);
}

.animal-name-pt {
    font-size: 1.3rem;
    color: var(--secondary-text);
    margin-bottom: 15px;
    font-weight: 400;
}

.animal-description {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--accent-text);
    margin-bottom: 20px;
}

.description-en, .description-pt {
    margin-bottom: 10px;
    padding: 8px;
    border-radius: 8px;
}

.description-en {
    background: rgba(0, 255, 136, 0.1);
    border-left: 3px solid var(--primary-text);
}

.description-pt {
    background: rgba(0, 212, 255, 0.1);
    border-left: 3px solid var(--accent-text);
}

.actions-en, .actions-pt {
    margin-bottom: 15px;
}

.actions-en strong, .actions-pt strong {
    color: var(--primary-text);
    font-family: 'Orbitron', monospace;
    font-size: 0.9rem;
    display: block;
    margin-bottom: 8px;
}

.conservation-actions {
    background: var(--accent-bg);
    padding: 15px;
    border-radius: 15px;
    border-left: 4px solid var(--primary-text);
    margin-bottom: 20px;
}

.conservation-actions h5 {
    color: var(--primary-text);
    margin-bottom: 10px;
    font-size: 1.1rem;
    font-family: 'Orbitron', monospace;
}

.action-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.action-item {
    color: var(--accent-text);
    font-size: 0.9rem;
    padding: 5px 0;
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
}

.action-item:last-child {
    border-bottom: none;
}

.impact-meter {
    background: var(--accent-bg);
    padding: 15px;
    border-radius: 15px;
    border-left: 4px solid var(--success-color);
}

.impact-meter h5 {
    color: var(--success-color);
    margin-bottom: 10px;
    font-size: 1.1rem;
    font-family: 'Orbitron', monospace;
}

.meter-bar {
    width: 100%;
    height: 12px;
    background: var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}

.meter-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 1s ease;
    position: relative;
}

.meter-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: meterShine 2s infinite;
}

@keyframes meterShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.meter-text {
    color: var(--accent-text);
    font-size: 0.9rem;
    margin: 0;
}

/* Game Over Modal */
.game-over-content {
    text-align: center;
}

.game-over-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.game-over-content h2 {
    font-size: 2.2rem;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(233, 69, 96, 0.3);
}

.game-over-content p {
    font-size: 1.1rem;
    margin-bottom: 25px;
    color: var(--accent-text);
}

.game-over-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 30px;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-text);
    text-shadow: 0 0 5px rgba(0, 212, 255, 0.3);
}

.stat-text {
    font-size: 0.9rem;
    color: var(--secondary-text);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.game-over-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.restart-btn, .next-level-btn, .menu-btn {
    border: none;
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition-medium);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--card-shadow);
    color: white;
}

.restart-btn {
    background: linear-gradient(135deg, var(--success-color), var(--accent-text));
}

.restart-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 255, 136, 0.4);
}

.next-level-btn {
    background: linear-gradient(135deg, var(--primary-text), var(--warning-color));
}

.next-level-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 255, 136, 0.4);
}

.menu-btn {
    background: linear-gradient(135deg, var(--secondary-text), var(--accent-text));
}

.menu-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.4);
}

.auto-advance-timer {
    margin: 20px 0;
    padding: 15px;
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: 10px;
}

.advance-timer-bar {
    width: 100%;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.advance-timer-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success-color), var(--primary-text));
    border-radius: 3px;
    animation: advanceCountdown 3s linear forwards;
}

@keyframes advanceCountdown {
    from { width: 100%; }
    to { width: 0%; }
}

.advance-timer-text {
    font-size: 0.9rem;
    color: var(--success-color);
    margin: 0;
    text-align: center;
}

#advance-seconds {
    font-weight: 600;
    color: var(--primary-text);
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    margin-top: 30px;
    color: var(--secondary-text);
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .credits p {
        font-size: 0.8rem;
    }
    
    .title-main {
        font-size: 2.2rem;
    }
    
    .title-sub {
        font-size: 0.9rem;
        letter-spacing: 2px;
    }
    
    .level-selector {
        flex-direction: column;
        gap: 10px;
    }
    
    .level-controls {
        order: -1;
    }
    
    .game-stats {
        gap: 10px;
    }
    
    .stat-item {
        min-width: 60px;
        padding: 6px 10px;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    .stat-value {
        font-size: 1.3rem;
    }
    
    .game-board {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 15px;
        padding: 15px;
    }
    
    .start-content {
        padding: 30px 20px;
        max-width: 90%;
    }
    
    .start-content h2 {
        font-size: 2rem;
    }
    
    .logo-icon {
        font-size: 3rem;
    }
    
    .level-preview h3 {
        font-size: 1.3rem;
    }
    
    .modal-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .auto-close-timer {
        max-width: none;
        order: 2;
    }
    
    .modal-close {
        align-self: flex-end;
        order: 1;
    }
    
    .animal-info {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .animal-image {
        flex: none;
        align-self: center;
        width: 200px;
    }
    
    .animal-image img {
        height: 200px;
    }
    
    .game-over-stats {
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .credits p {
        font-size: 0.7rem;
        padding: 6px 10px;
    }
    
    .title-main {
        font-size: 1.8rem;
    }
    
    .level-display {
        font-size: 1.5rem;
    }
    
    .level-btn {
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }
    
    .game-stats {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .stat-item {
        min-width: 50px;
        padding: 4px 8px;
    }
    
    .game-board {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 10px;
        padding: 10px;
    }
    
    .modal-content {
        padding: 20px;
        width: 95%;
        max-height: 90vh;
    }
    
    .animal-image {
        width: 150px;
    }
    
    .animal-image img {
        height: 150px;
    }
    
    .animal-name-en {
        font-size: 1.4rem;
    }
    
    .animal-name-pt {
        font-size: 1.1rem;
    }
    
    .start-content h2 {
        font-size: 1.8rem;
    }
    
    .logo-icon {
        font-size: 2.5rem;
    }
    
    .start-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .start-btn, .new-session-btn {
        width: 100%;
        max-width: 250px;
        justify-content: center;
    }
    
    .game-over-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .restart-btn, .next-level-btn, .menu-btn {
        width: 100%;
        max-width: 250px;
        justify-content: center;
    }
}

/* Animações adicionais */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.pulse {
    animation: pulse 1s infinite;
}

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

.shake {
    animation: shake 0.5s ease-in-out;
}

/* Efeitos de partículas para celebração */
@keyframes confetti {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(-100vh) rotate(360deg); opacity: 0; }
}

.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: var(--success-color);
    animation: confetti 3s linear infinite;
}

/* Animações adicionais para tema disruptivo */
@keyframes glitchEffect {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
}

.glitch {
    animation: glitchEffect 0.3s ease-in-out;
}

/* Efeito de scan line futurista */
.header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--neon-blue), transparent);
    animation: scanLine 2s linear infinite;
}

@keyframes scanLine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Efeito holográfico nos botões */
.start-btn, .restart-btn {
    position: relative;
    overflow: hidden;
}

.start-btn::before, .restart-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.start-btn:hover::before, .restart-btn:hover::before {
    left: 100%;
}

/* Efeito de typing para textos */
@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

.typing-effect {
    overflow: hidden;
    white-space: nowrap;
    animation: typing 2s steps(40, end);
}

/* Efeito de matrix rain (sutil) */
.particles-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, var(--neon-green), transparent),
        radial-gradient(2px 2px at 40px 70px, var(--neon-blue), transparent),
        radial-gradient(1px 1px at 90px 40px, var(--neon-purple), transparent);
    background-repeat: repeat;
    background-size: 100px 100px;
    animation: matrixRain 20s linear infinite;
    opacity: 0.1;
}

@keyframes matrixRain {
    0% { transform: translateY(-100px); }
    100% { transform: translateY(100vh); }
}

/* Efeito de energia nos cards matched */
.card.matched::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--neon-green), var(--neon-blue), var(--neon-purple), var(--neon-green));
    border-radius: 22px;
    z-index: -1;
    animation: energyFlow 2s linear infinite;
}

@keyframes energyFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Efeito de distorção no game over */
.game-over-content.victory {
    animation: victoryGlow 1s ease-in-out;
}

@keyframes victoryGlow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.2) saturate(1.3); }
}

/* Indicador de progresso futurista */
.progress-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--border-color);
    z-index: 1000;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-green), var(--neon-blue));
    transition: width 0.3s ease;
    box-shadow: 0 0 10px currentColor;
}

/* Efeito de partículas de sucesso */
.success-particle {
    position: fixed;
    width: 4px;
    height: 4px;
    background: var(--success-color);
    border-radius: 50%;
    pointer-events: none;
    animation: successParticle 1s ease-out forwards;
}

@keyframes successParticle {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0) translateY(-50px);
    }
}

/* Tema escuro aprimorado */
.dark-mode-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--accent-bg);
    border: 1px solid var(--border-color);
    color: var(--accent-text);
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-medium);
    z-index: 1000;
}

.dark-mode-toggle:hover {
    background: var(--primary-text);
    color: var(--primary-bg);
    box-shadow: 0 0 15px var(--primary-text);
}

/* Responsividade aprimorada para dispositivos muito pequenos */
@media (max-width: 320px) {
    .title-main {
        font-size: 1.5rem;
    }
    
    .game-board {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .stat-item {
        min-width: 50px;
        padding: 4px 8px;
    }
    
    .stat-value {
        font-size: 1.1rem;
    }
    
    .level-selector {
        padding: 10px;
    }
    
    .modal-content {
        padding: 15px;
        margin: 10px;
    }
}

/* Acessibilidade aprimorada */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Modo de alto contraste */
@media (prefers-contrast: high) {
    :root {
        --primary-text: #ffffff;
        --secondary-text: #ffffff;
        --accent-text: #ffffff;
        --border-color: #ffffff;
        --primary-bg: #000000;
        --secondary-bg: #111111;
    }
}

/* Suporte para temas do sistema */
@media (prefers-color-scheme: light) {
    .light-theme {
        --primary-bg: #f0f0f0;
        --secondary-bg: #ffffff;
        --accent-bg: #e0e0e0;
        --primary-text: #00aa66;
        --secondary-text: #0088cc;
        --accent-text: #333333;
        --border-color: #cccccc;
    }
}