.top-section {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
}

.box-memoria {
    flex: 1;
    border: 2px solid var(--primary-green);
    border-radius: 12px;
    background: white;
    overflow: hidden;
}

.box-header {
    background: var(--light-green);
    padding: 10px;
    text-align: center;
    font-weight: bold;
    border-bottom: 2px solid var(--primary-green);
    color: var(--primary-green);
}

table.mem-table { width: 100%; border-collapse: collapse; font-family: monospace; font-size: 0.95rem; }
.mem-table td, .mem-table th { padding: 10px; border-bottom: 1px solid #eee; text-align: center; }
.row-active { background-color: var(--warning-orange) !important; color: white !important; font-weight: bold; }

.codigo-box { 
    padding: 20px; 
    background: #1e1e1e; 
    color: #dcdcdc; 
    font-family: 'Consolas', 'Courier New', monospace; 
    font-size: 1rem; 
    height: 100%; 
    box-sizing: border-box; 
}

.simulation-area {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    margin-top: 20px;
}

.flowchart-container { flex: 0 0 250px; position: relative; }
.flowchart {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #fff;
    padding: 20px 15px;
    border-radius: 15px;
    border: 2px solid var(--light-green);
    position: relative;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
.shadow-sm{
    margin: 15px 0px;
}
.node {
    width: 100%;
    padding: 10px 5px;
    text-align: center;
    background: white;
    border: 2px solid var(--primary-green);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: bold;
    z-index: 2;
    transition: 0.3s;
}

.node.active { 
    background: var(--warning-orange); 
    color: white;
    border-color: var(--warning-orange);
    transform: scale(1.05); 
    box-shadow: 0 4px 12px rgba(230, 126, 34, 0.3); 
}

.arrow-v { 
    width: 2px; 
    background: var(--primary-green); 
    height: 25px; 
    margin: -2px 0; 
    position: relative; 
    z-index: 1; 
}

.arrow-v::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid var(--primary-green);
}

.loop-return {
    position: absolute;
    left: -12px; top: 110px; bottom: 50px; width: 20px;
    border: 2px solid var(--primary-green); border-right: none; border-radius: 12px 0 0 12px;
}

.processor-container { 
    flex: 1; 
    position: relative; 
    background: white; 
    border-radius: 20px; 
    padding: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.processador-img { width: 100%; display: block; border-radius: 15px; }

#raio-clock {
    position: absolute;
    top: 75.5%; left: 14%;
    font-size: 3.5rem;
    color: #f1c40f;
    opacity: 0;
    z-index: 30;
    pointer-events: none;
    text-shadow: 0 0 15px rgba(241, 196, 15, 0.6);
}

.pulse-raio { animation: pulse-raio 0.5s ease-out; }

.data-card {
    position: absolute;
    background: var(--warning-orange);
    color: white;
    padding: 5px 12px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 0.95rem;
    box-shadow: 2px 4px 10px rgba(0,0,0,0.2);
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10;
}

.data-card.visible { opacity: 1; transform: scale(1); }

.rdm-mini-table { border-collapse: collapse; background: white; color: black; font-size: 0.8rem; width: 90px; }
.rdm-mini-table td { border: 1px solid #ddd; padding: 3px; text-align: center; }

#card-pc  { top: 26%; left: 51%; }
#card-rem { top: 45.6%; left: 68.7%; }
#card-rdm { top: 24%; left: 68.7%; padding: 3px; background: var(--primary-green); }
#card-ri  { top: 68.3%; left: 44.9%; }
#card-ula { top: 31%; left: 14%; }
#card-acc { top: 14.5%; left: 16.5%; }

@keyframes pulse-raio {
    0% { opacity: 0; transform: scale(0.5); }
    50% { opacity: 1; transform: scale(1.4); }
    100% { opacity: 0; transform: scale(1); }
}

@media (max-width: 992px) {
    .simulation-area, .top-section { flex-direction: column; }
    .flowchart-container { width: 100%; margin-bottom: 30px; }
}